private void loadDefaultConfig ( ) { this . configDir = System . getProperty ( CONFIG_DIR_SYS_PROP ) ; if ( this . configDir == null ) { this . configDir = getDefaultConfigDir ( ) ; } if ( this . configDir == null ) { throw new AssertionError ( "eureka.config.dir not specified in " + FALLBACK_CONFIG_FILE ) ; } File configFile = new File ( this . configDir , PROPERTIES_FILENAME ) ; if ( configFile . exists ( ) ) { LOGGER . info ( "Trying to load default configuration from {}" , configFile . getAbsolutePath ( ) ) ; InputStream inputStream = null ; try { inputStream = new FileInputStream ( configFile ) ; this . properties . load ( inputStream ) ; inputStream . close ( ) ; inputStream = null ; } catch ( IOException ex ) { LOGGER . error ( "Error reading application.properties file {}: {}. " + "Built-in defaults will be used, some " + "of which are unlikely to be what you want." , configFile . getAbsolutePath ( ) , ex . getMessage ( ) ) ; } finally { if ( inputStream != null ) { try { inputStream . close ( ) ; } catch ( IOException ignore ) { } } } } else { LOGGER . warn ( "No configuration file found at {}. " + "Built-in defaults will be used, some " + "of which are unlikely to be what you want." , configFile . getAbsolutePath ( ) ) ; } }
Loads the application configuration .