@Test public void testAddEncodingSystemProperty() throws Exception { Properties p = new Properties(); p.setProperty(SYSTEM_PROPERTY_PREFIX + "zzlc.encrypted", encode(DEFAULT_VALUE)); SystemPropertiesUtil.addSystemProperties(p); assertEquals(DEFAULT_VALUE, System.getProperty("zzlc.encrypted")); }
public static void addSystemProperties(Properties p) { try { Properties sysProps = getPropertySubset(p, Constants.SYSTEM_PROPERTY_PREFIX, true); if (sysProps.size() > 0) { PropertyResolver resolver = PropertyResolver.getDefaultInstance(); for (String keyWithPrefix : sysProps.stringPropertyNames()) { String syspropKey = keyWithPrefix.substring(Constants.SYSTEM_PROPERTY_PREFIX.length()); String toBeResolved = sysProps.getProperty(keyWithPrefix); String syspropValue = resolver.resolve(toBeResolved); if (log.isTraceEnabled()) { if (syspropValue.equals(toBeResolved)) { log.trace("Adding " + syspropKey + "=" + toBeResolved + " to system properties"); } else { log.trace("Adding " + syspropKey + "=PropertyResolver#resolve(" + toBeResolved + ") to system properties"); } } System.setProperty(syspropKey, syspropValue); } } } catch (Exception ex) { log.error("Error during setting system properties", ex); } }
SystemPropertiesUtil { public static void addSystemProperties(Properties p) { try { Properties sysProps = getPropertySubset(p, Constants.SYSTEM_PROPERTY_PREFIX, true); if (sysProps.size() > 0) { PropertyResolver resolver = PropertyResolver.getDefaultInstance(); for (String keyWithPrefix : sysProps.stringPropertyNames()) { String syspropKey = keyWithPrefix.substring(Constants.SYSTEM_PROPERTY_PREFIX.length()); String toBeResolved = sysProps.getProperty(keyWithPrefix); String syspropValue = resolver.resolve(toBeResolved); if (log.isTraceEnabled()) { if (syspropValue.equals(toBeResolved)) { log.trace("Adding " + syspropKey + "=" + toBeResolved + " to system properties"); } else { log.trace("Adding " + syspropKey + "=PropertyResolver#resolve(" + toBeResolved + ") to system properties"); } } System.setProperty(syspropKey, syspropValue); } } } catch (Exception ex) { log.error("Error during setting system properties", ex); } } }
SystemPropertiesUtil { public static void addSystemProperties(Properties p) { try { Properties sysProps = getPropertySubset(p, Constants.SYSTEM_PROPERTY_PREFIX, true); if (sysProps.size() > 0) { PropertyResolver resolver = PropertyResolver.getDefaultInstance(); for (String keyWithPrefix : sysProps.stringPropertyNames()) { String syspropKey = keyWithPrefix.substring(Constants.SYSTEM_PROPERTY_PREFIX.length()); String toBeResolved = sysProps.getProperty(keyWithPrefix); String syspropValue = resolver.resolve(toBeResolved); if (log.isTraceEnabled()) { if (syspropValue.equals(toBeResolved)) { log.trace("Adding " + syspropKey + "=" + toBeResolved + " to system properties"); } else { log.trace("Adding " + syspropKey + "=PropertyResolver#resolve(" + toBeResolved + ") to system properties"); } } System.setProperty(syspropKey, syspropValue); } } } catch (Exception ex) { log.error("Error during setting system properties", ex); } }  }
SystemPropertiesUtil { public static void addSystemProperties(Properties p) { try { Properties sysProps = getPropertySubset(p, Constants.SYSTEM_PROPERTY_PREFIX, true); if (sysProps.size() > 0) { PropertyResolver resolver = PropertyResolver.getDefaultInstance(); for (String keyWithPrefix : sysProps.stringPropertyNames()) { String syspropKey = keyWithPrefix.substring(Constants.SYSTEM_PROPERTY_PREFIX.length()); String toBeResolved = sysProps.getProperty(keyWithPrefix); String syspropValue = resolver.resolve(toBeResolved); if (log.isTraceEnabled()) { if (syspropValue.equals(toBeResolved)) { log.trace("Adding " + syspropKey + "=" + toBeResolved + " to system properties"); } else { log.trace("Adding " + syspropKey + "=PropertyResolver#resolve(" + toBeResolved + ") to system properties"); } } System.setProperty(syspropKey, syspropValue); } } } catch (Exception ex) { log.error("Error during setting system properties", ex); } }  static void addSystemProperties(Properties p); static void addJndiProperties(Properties bootstrapProperties); }
SystemPropertiesUtil { public static void addSystemProperties(Properties p) { try { Properties sysProps = getPropertySubset(p, Constants.SYSTEM_PROPERTY_PREFIX, true); if (sysProps.size() > 0) { PropertyResolver resolver = PropertyResolver.getDefaultInstance(); for (String keyWithPrefix : sysProps.stringPropertyNames()) { String syspropKey = keyWithPrefix.substring(Constants.SYSTEM_PROPERTY_PREFIX.length()); String toBeResolved = sysProps.getProperty(keyWithPrefix); String syspropValue = resolver.resolve(toBeResolved); if (log.isTraceEnabled()) { if (syspropValue.equals(toBeResolved)) { log.trace("Adding " + syspropKey + "=" + toBeResolved + " to system properties"); } else { log.trace("Adding " + syspropKey + "=PropertyResolver#resolve(" + toBeResolved + ") to system properties"); } } System.setProperty(syspropKey, syspropValue); } } } catch (Exception ex) { log.error("Error during setting system properties", ex); } }  static void addSystemProperties(Properties p); static void addJndiProperties(Properties bootstrapProperties); static final String NAMING_PACKAGE; }