@Override protected void loadProperties(Properties props) throws IOException { try { super.loadProperties(props); } catch (FileNotFoundException e) { // location was not found, create if (configFile != null && copyOutTemplate) { try (OutputStream fout = configFile.out()) { props.store(fout, comments); fout.flush(); } } } }
@Override protected void loadProperties(Properties props) throws IOException { super.loadProperties(props); for (Map.Entry<Object,Object> entry : props.entrySet()) { String key = entry.getKey().toString(); if (key.startsWith("system.")) { key = key.substring(7); System.setProperty(key, (String) entry.getValue()); } } } }
protected void loadProperties(Properties props) throws IOException { super.loadProperties(props); // Override everything with the environment variables for(Map.Entry<String,String> entry : System.getenv().entrySet()) { props.put(entry.getKey(), entry.getValue()); } // Lastly override everything with the system properties for (Map.Entry<Object,Object> entry : System.getProperties().entrySet()) { props.put(entry.getKey(), entry.getValue()); } } }
@Override protected void loadProperties(Properties props) throws IOException { super.loadProperties(props); ctxPropertiesMap = new HashMap<String, String>(); for (Object key : props.keySet()) { String keyStr = key.toString(); String value = props.getProperty(keyStr); if (decryptProperties != null && decryptProperties.contains(keyStr)) { value = SecurityUtil.decryptDes(value, KEY); props.setProperty(keyStr, value); } ctxPropertiesMap.put(keyStr, value); } }
@Override protected void loadProperties(Properties props) throws IOException { super.loadProperties(props); ctxPropertiesMap = new HashMap<String, String>(); for (Object key : props.keySet()) { String keyStr = key.toString(); String value = props.getProperty(keyStr); if (decryptProperties != null && decryptProperties.contains(keyStr)) { value = SecurityUtil.decryptDes(value, KEY); props.setProperty(keyStr, value); } ctxPropertiesMap.put(keyStr, value); } }
@Override protected void loadProperties(final Properties props) throws IOException { super.setLocations(locations); setIgnoreUnresolvablePlaceholders(true); // Load the properties super.loadProperties(props); // Save the global properties setGlobalProperties(props); }
/** * Load properties into the given instance. * * @param props * the Properties instance to load into * @throws IOException * in case of I/O errors * @see #setLocations * @see #setJndiLocations */ protected void loadProperties(Properties props) throws IOException { super.loadProperties(props); try { loadJndi(props); } catch (NamingException e) { LOGGER.error("load jndi properties failed! ignore jndi properties loading"); } if (getPropertyResolvedInterceptor() != null) { getPropertyResolvedInterceptor().onPropertiesLoad(props); } }