this(new AppAdminFactory(), cmdLineArgs);
}
public AppCfg(AppAdminFactory factory, String[] cmdLineArgs) {
connectOptions = new ConnectOptions();
Parser parser = new Parser();
PrintWriter logWriter;
try {
logFile = File.createTempFile("appcfg", ".log");
logWriter = new PrintWriter(new FileWriter(logFile), true);
} catch (IOException e) {
throw new RuntimeException("Unable to enable logging.", e);
}
try {
ParseResult result =
parser.parseArgs(actionsAndOptions.actions, actionsAndOptions.options, cmdLineArgs);
action = (AppCfgAction) result.getAction();
validateCommandLineForEar();
try {
result.applyArgs();
} catch (IllegalArgumentException e) {