// Path: src/main/java/ch/cyclops/load/Loader.java
// public class Loader {
// //    final static Logger logger = LogManager.getLogger(Loader.class.getName());
// 
//     // singleton pattern
//     private static Loader singleton;
// 
//     // loaded settings and environment
//     private Settings settings;
// 
//     /**
//      * Constructor has to be private, as we are using singleton
//      */
//     private Loader(String path) throws Exception {
//         // only if object is created by createInstance (which gives it context)
//         if (!path.isEmpty()) {
//             // start with loading config file
//             Properties properties = loadAndParseConfigurationFile(path);
// 
//             if (properties == null) {
//                 throw new Exception();
//             }
// 
//             settings = new Settings(properties);
//         }
//     }
// 
//     /**
//      * When creating instance, we need it to have context
//      * @param path for the configuration file
//      */
//     public static void createInstance(String path) throws Exception {
//         if (singleton == null) {
//             singleton = new Loader(path);
//         }
//     }
// 
//     /**
//      * Access settings from Loader class
//      * @return settings object or null
//      */
//     public static Settings getSettings() {
//         if (singleton.settings != null) {
//             return singleton.settings;
//         } else {
//             return null;
//         }
//     }
// 
//     /**
//      * Load and parse configuration file
//      * @return null or property object
//      */
//     private Properties loadAndParseConfigurationFile(String path) {
//         // store everything into property variable
//         Properties prop = new Properties();
// 
//         try {
//             // load file
//             InputStream input = new FileInputStream(path);
// 
//             // now feed input file to property loader
//             prop.load(input);
// 
//             return prop;
// 
//         } catch (FileNotFoundException e) {
// //            logger.error("Configuration file doesn't exist or cannot be loaded: " + e.getMessage());
//             return null;
//         } catch (IOException e) {
// //            logger.error("Couldn't load configuration file: " + e.getMessage());
//             return null;
//         }
//     }
// }


import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import ch.cyclops.load.Loader;
            String log = "A configuration file path has to be provided (as argument), otherwise UDR micro service cannot be properly loaded";
//            logger.error(log);
            System.err.println(log);
            System.exit(ERR_PARAMS);
        }

        outputProgressBar();
    }

    /**
     * Check whether parameter was help
     * @param param to be examined
     */
    private static void checkHelp(String param) {
        if (param.equals("-h") || param.equals("--help")) {
            System.out.println(helpMessage);
            System.exit(OK_HELP);
            System.exit(0);
        }

//        outputProgressBar();
    }

    /**
     * Make sure configuration file is valid
     * @param param path
     */
    private static void checkConfigurationFile(String param) {
        try {
            // create and parse configuration settings
// Path: src/main/java/ch/cyclops/load/Loader.java
// public class Loader {
// //    final static Logger logger = LogManager.getLogger(Loader.class.getName());
// 
//     // singleton pattern
//     private static Loader singleton;
// 
//     // loaded settings and environment
//     private Settings settings;
// 
//     /**
//      * Constructor has to be private, as we are using singleton
//      */
//     private Loader(String path) throws Exception {
//         // only if object is created by createInstance (which gives it context)
//         if (!path.isEmpty()) {
//             // start with loading config file
//             Properties properties = loadAndParseConfigurationFile(path);
// 
//             if (properties == null) {
//                 throw new Exception();
//             }
// 
//             settings = new Settings(properties);
//         }
//     }
// 
//     /**
//      * When creating instance, we need it to have context
//      * @param path for the configuration file
//      */
//     public static void createInstance(String path) throws Exception {
//         if (singleton == null) {
//             singleton = new Loader(path);
//         }
//     }
// 
//     /**
//      * Access settings from Loader class
//      * @return settings object or null
//      */
//     public static Settings getSettings() {
//         if (singleton.settings != null) {
//             return singleton.settings;
//         } else {
//             return null;
//         }
//     }
// 
//     /**
//      * Load and parse configuration file
//      * @return null or property object
//      */
//     private Properties loadAndParseConfigurationFile(String path) {
//         // store everything into property variable
//         Properties prop = new Properties();
// 
//         try {
//             // load file
//             InputStream input = new FileInputStream(path);
// 
//             // now feed input file to property loader
//             prop.load(input);
// 
//             return prop;
// 
//         } catch (FileNotFoundException e) {
// //            logger.error("Configuration file doesn't exist or cannot be loaded: " + e.getMessage());
//             return null;
//         } catch (IOException e) {
// //            logger.error("Couldn't load configuration file: " + e.getMessage());
//             return null;
//         }
//     }
// }


// Path: src/main/java/ch/cyclops/Application.java
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import ch.cyclops.load.Loader;

            String log = "A configuration file path has to be provided (as argument), otherwise UDR micro service cannot be properly loaded";
//            logger.error(log);
            System.err.println(log);
            System.exit(ERR_PARAMS);
        }

        outputProgressBar();
    }

    /**
     * Check whether parameter was help
     * @param param to be examined
     */
    private static void checkHelp(String param) {
        if (param.equals("-h") || param.equals("--help")) {
            System.out.println(helpMessage);
            System.exit(OK_HELP);
            System.exit(0);
        }

//        outputProgressBar();
    }

    /**
     * Make sure configuration file is valid
     * @param param path
     */
    private static void checkConfigurationFile(String param) {
        try {
            // create and parse configuration settings
            Loader.createInstance(param);