/*******************************************************************************
 * Copyright (c) 2008 IGA Tosiki, NTT DATA BUSINESS BRAINS Corp.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *    IGA Tosiki (NTT DATA BUSINESS BRAINS Corp.) - initial API and implementation
 *******************************************************************************/
/*
 * blanco Framework
 * Copyright (C) 2008 NTT DATA BUSINESS BRAINS CORPORATION
 * 
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 */
package blanco.nlpack.generator.task;

import java.io.File;
import java.io.IOException;

import blanco.nlpack.generator.task.valueobject.BlancoNLpackGeneratorPluginDirectory2JarProcessInput;
import blanco.properties.BlancoPropertiesDirectory2Jar;

/**
 * Antタスク「blancoNLpackGeneratorPluginDirectory2Jar」のエントリポイント。
 * 
 * @author IGA Tosiki
 */
public class BlancoNLpackGeneratorPluginDirectory2JarProcessImpl implements
        BlancoNLpackGeneratorPluginDirectory2JarProcess {

    /**
     * クラスをインスタンス化して処理を実行する際のエントリポイントです。
     * 
     * @param input
     *            処理の入力パラメータ。
     * @return 処理の実行結果。
     * @throws IOException
     *             入出力例外が発生した場合。
     * @throws IllegalArgumentException
     *             入力値に不正が見つかった場合。
     */
    public int execute(
            final BlancoNLpackGeneratorPluginDirectory2JarProcessInput input)
            throws IOException, IllegalArgumentException {
        final BlancoPropertiesDirectory2Jar processor = new BlancoPropertiesDirectory2Jar();
        processor.process(new File(input.getSourcedir()), new File(input
                .getTargetdir()));

        return BlancoNLpackGeneratorPluginDirectory2JarBatchProcess.END_SUCCESS;
    }
}
