com.codetaco.funnel.AppContext Maven / Gradle / Ivy
package com.codetaco.funnel;
import java.io.File;
import java.io.IOException;
import java.text.ParseException;
import com.codetaco.argument.CmdLine;
import com.codetaco.argument.annotation.Arg;
import com.codetaco.argument.input.NamespaceParser;
/**
*
* AppContext class.
*
*
* @author Chris DeGreef [email protected]
*/
public class AppContext
{
@Arg(caseSensitive = true, defaultValues = "UNKNOWN")
public String version;
@Arg(multimin = 1)
public String[] specPath;
@Arg(longName = "log4j", caseSensitive = true)
public String log4jConfigFileName;
/**
*
* Constructor for AppContext.
*
*/
public AppContext()
{
super();
}
/**
*
* Constructor for AppContext.
*
*
* @param workingDirectory a {@link java.lang.String} object.
* @throws java.io.IOException if any.
* @throws java.text.ParseException if any.
*/
public AppContext(final String workingDirectory) throws IOException, ParseException
{
final String configFileName = System.getProperty("funnel.config",
workingDirectory + "/src/test/resources/funnel.cfg");
new CmdLine().parse(NamespaceParser.getInstance(new File(configFileName)), this);
}
}