All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.vlinx.java.wrapper.CLIMain Maven / Gradle / Ivy

There is a newer version: 1.0.5
Show newest version
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);
        }

    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy