class StartupConfig {

    public static StartupConfig load() {
        String styxHome = System.getProperty(STYX_HOME_VAR_NAME);

        checkArgument(styxHome != null, "No system property %s has been defined.", STYX_HOME_VAR_NAME);
        checkArgument(isReadable(Paths.get(styxHome)), "%s=%s is not a readable configuration path.", STYX_HOME_VAR_NAME, styxHome);

        String configFileLocation = System.getProperty(CONFIG_FILE_LOCATION_VAR_NAME);

        if (configFileLocation == null) {
            configFileLocation = Paths.get(styxHome).resolve("conf/default.yml").toString();
        }

        String logbackConfigLocation = System.getProperty(LOGBACK_CONFIG_LOCATION_VAR_NAME);

        if (logbackConfigLocation == null) {
            logbackConfigLocation = Paths.get(styxHome).resolve("conf/logback.xml").toString();
        }

        return new Builder()
                .styxHome(styxHome)
                .configFileLocation(configFileLocation)
                .logbackConfigLocation(logbackConfigLocation)
                .build();
    }

    private  StartupConfig(Builder builder);

}