io.vlinx.java.wrapper.CLIMain Maven / Gradle / Ivy
package io.vlinx.java.wrapper;
import io.vlinx.configutils.YAMLUtils;
import io.vlinx.configutils.exception.YAMLException;
import io.vlinx.logging.Logger;
import java.io.IOException;
public class CLIMain {
public static void main(String[] args) {
Logger.INFO(Constants.APP_TITLE);
if (args.length < 1) {
System.out.println("Usage java-wrapper [config-file-path]");
System.exit(1);
}
String configFilePath = args[0];
Logger.INFO("Config file", configFilePath);
Config config = null;
try {
config = (Config) YAMLUtils.loadObject(configFilePath, Config.class);
} catch (IOException | YAMLException e) {
Logger.ERROR(e);
System.exit(1);
}
JavaWrapper wrapper = new JavaWrapper(config);
try {
wrapper.run();
} catch (Exception e) {
Logger.ERROR(e);
System.exit(1);
}
}
}