public static void init ( ) { // Get configuration // Read from "server.properties" or custom file. String configFile = null ; Properties serverProperties = new Properties ( ) ; try { configFile = System . getProperty ( PROPERTY_PREFIX + "config" , "server.properties" ) ; LOG . info ( "Loading server configuration from " + configFile ) ; try ( InputStream is = new FileInputStream ( configFile ) ) { serverProperties . load ( is ) ; } } catch ( FileNotFoundException e ) { LOG . warn ( configFile + " not found." ) ; } catch ( IOException e ) { LOG . error ( "Unexpected error reading " + configFile ) ; } init ( serverProperties ) ; }
Read server configuration from System properties and from server . properties .