Source:
public static void loadBootProperties(URL directory, String environmentPropertiesLocation, Properties environmentProperties) throws IOException { URL bootPropertiesFile = new URL(directory, environmentPropertiesLocation); System.setProperty(ENVIRONMENT_PROPERTIES, environmentPropertiesLocation); environmentProperties.load(bootPropertiesFile.openStream()); String userBootPropertiesLocationsString = System.getProperty(USER_ENVIRONMENT_PROPERTIES); if (userBootPropertiesLocationsString == null) { userBootPropertiesLocationsString = environmentProperties.getProperty(USER_ENVIRONMENT_PROPERTIES); } if(userBootPropertiesLocationsString != null){ String[] userBootPropertiesSingleLocations = userBootPropertiesLocationsString.split(","); for (String location : userBootPropertiesSingleLocations) { URL userBootPropertiesFile = new URL(directory, location); Properties userBootProperties = new Properties(); userBootProperties.load(userBootPropertiesFile.openStream()); for (String name : userBootProperties.stringPropertyNames()) { environmentProperties.setProperty(name, userBootProperties.getProperty(name)); } } } else { userBootPropertiesLocationsString = DEFAULT_USER_ENVIRONMENT_PROPERTIES_LOCATION; } String defaultBootPropertiesLocation = System.getProperty(DEFAULT_ENVIRONMENT_PROPERTIES); if (defaultBootPropertiesLocation == null) { defaultBootPropertiesLocation = environmentProperties.getProperty(DEFAULT_ENVIRONMENT_PROPERTIES); } if(defaultBootPropertiesLocation==null){ defaultBootPropertiesLocation=DEFAULT_ENVIRONMENT_PROPERTIES_LOCATION; } URL defaultBootPropertiesFile = new URL(directory, defaultBootPropertiesLocation); Properties defaultBootProperties = new Properties(); defaultBootProperties.load(defaultBootPropertiesFile.openStream()); for (String name : defaultBootProperties.stringPropertyNames()) { if (!environmentProperties.containsKey(name)) { environmentProperties.setProperty(name, defaultBootProperties.getProperty(name)); } } Properties properties = System.getProperties(); for (Enumeration<String> enumeration = (Enumeration<String>) properties.propertyNames(); enumeration.hasMoreElements(); ) { String key = enumeration.nextElement(); environmentProperties.put(key, properties.get(key)); } System.setProperty(ENVIRONMENT_PROPERTIES, environmentPropertiesLocation); System.setProperty(USER_ENVIRONMENT_PROPERTIES,userBootPropertiesLocationsString); System.setProperty(DEFAULT_ENVIRONMENT_PROPERTIES, defaultBootPropertiesLocation); }

Target:
public static void loadBootProperties(URL directory, String environmentPropertiesLocation, Properties environmentProperties) throws IOException { URL bootPropertiesFile = new URL(directory, environmentPropertiesLocation); System.setProperty(ENVIRONMENT_PROPERTIES, environmentPropertiesLocation); environmentProperties.load(bootPropertiesFile.openStream()); String userBootPropertiesLocationsString = System.getProperty(USER_ENVIRONMENT_PROPERTIES); if (userBootPropertiesLocationsString == null) { userBootPropertiesLocationsString = environmentProperties.getProperty(USER_ENVIRONMENT_PROPERTIES); } if (userBootPropertiesLocationsString == null) { userBootPropertiesLocationsString = DEFAULT_USER_ENVIRONMENT_PROPERTIES_LOCATION; } String[] userBootPropertiesSingleLocations = userBootPropertiesLocationsString.split(","); for (String location : userBootPropertiesSingleLocations) { URL userBootPropertiesFile = new URL(directory, location); Properties userBootProperties = new Properties(); userBootProperties.load(userBootPropertiesFile.openStream()); for (String name : userBootProperties.stringPropertyNames()) { environmentProperties.setProperty(name, userBootProperties.getProperty(name)); } } String defaultBootPropertiesLocation = System.getProperty(DEFAULT_ENVIRONMENT_PROPERTIES); if (defaultBootPropertiesLocation == null) { defaultBootPropertiesLocation = environmentProperties.getProperty(DEFAULT_ENVIRONMENT_PROPERTIES); } if(defaultBootPropertiesLocation==null){ defaultBootPropertiesLocation=DEFAULT_ENVIRONMENT_PROPERTIES_LOCATION; } URL defaultBootPropertiesFile = new URL(directory, defaultBootPropertiesLocation); Properties defaultBootProperties = new Properties(); defaultBootProperties.load(defaultBootPropertiesFile.openStream()); for (String name : defaultBootProperties.stringPropertyNames()) { if (!environmentProperties.containsKey(name)) { environmentProperties.setProperty(name, defaultBootProperties.getProperty(name)); } } Properties properties = System.getProperties(); for (Enumeration<String> enumeration = (Enumeration<String>) properties.propertyNames(); enumeration.hasMoreElements(); ) { String key = enumeration.nextElement(); environmentProperties.put(key, properties.get(key)); } System.setProperty(ENVIRONMENT_PROPERTIES, environmentPropertiesLocation); System.setProperty(USER_ENVIRONMENT_PROPERTIES,userBootPropertiesLocationsString); System.setProperty(DEFAULT_ENVIRONMENT_PROPERTIES, defaultBootPropertiesLocation); }