/** * Get value for property bound to the class loader. * If not found, then return default. * * @param classLoader The classloader used to load resources. * @param propertyName property name. * @param dephault default value. * @return property value if found, otherwise default. */ public static String getProperty(ClassLoader classLoader, String propertyName, String dephault) { String value = getProperty(classLoader, propertyName); return (value == null) ? dephault : value; }
/** * Get value for property bound to the current thread context class loader. * If not found, then return default. * * @param propertyName property name. * @param dephault default value. * @return property value if found, otherwise default. */ public static String getProperty(String propertyName, String dephault) { return ManagedProperties.getProperty(propertyName, dephault); }
/** * Get value for property bound to the current thread context class loader. * * @param propertyName property name. * @return property value if found, otherwise default. */ public static String getProperty(String propertyName) { return ManagedProperties.getProperty(propertyName); }
/** * Get value for property bound to the current thread context class loader. * * @param propertyName property name. * @return property value if found, otherwise default. */ public static String getProperty(String propertyName) { return ManagedProperties.getProperty(propertyName); }
/** * Get value for property bound to the current thread context class loader. * If not found, then return default. * * @param propertyName property name. * @param dephault default value. * @return property value if found, otherwise default. */ public static String getProperty(String propertyName, String dephault) { return ManagedProperties.getProperty(propertyName, dephault); }
/** * Get value for property bound to the current thread context class loader. * * @param propertyName property name. * @return property value if found, otherwise default. */ public static String getProperty(String propertyName) { return ManagedProperties.getProperty(propertyName); }
/** * Get value for property bound to the current thread context class loader. * If not found, then return default. * * @param propertyName property name. * @param dephault default value. * @return property value if found, otherwise default. */ public static String getProperty(String propertyName, String dephault) { return ManagedProperties.getProperty(propertyName, dephault); }
/** * Load the class whose name is given by the value of a (Managed) * System Property. * * @param propertyName the name of the system property whose value is * the name of the class to load. * @return The managed property value * @see ManagedProperties */ public static String getManagedProperty(String propertyName) { String value; try { value = ManagedProperties.getProperty(propertyName); } catch (SecurityException e) { value = null; } return value; }
/** * Get value for property bound to the current thread context class loader. * If not found, then return default. * * @param propertyName property name. * @param dephault default value. * @return property value if found, otherwise default. */ public static String getProperty(String propertyName, String dephault) { return getProperty(getThreadContextClassLoader(), propertyName, dephault); }
/** * Get value for property bound to the current thread context class loader. * * @param propertyName property name. * @return property value if found, otherwise default. */ public static String getProperty(String propertyName) { return getProperty(getThreadContextClassLoader(), propertyName); }
/** * {@inheritDoc} */ @Override public ResourceNameIterator findResourceNames(final String resourceName) { final String mappedName = mapping.get(resourceName); if (log.isDebugEnabled()) { if (mappedName == null) { log.debug("find: resourceName='" + resourceName + "', no mapping"); } else { log.debug("find: resourceName='" + resourceName + "', lookup property '" + mappedName + "'"); } } return new ResourceNameIterator() { private String resource = (mappedName == null) ? null : ManagedProperties.getProperty(mappedName); public boolean hasNext() { return resource != null; } public String nextResourceName() { String element = resource; resource = null; return element; } }; }
private String resource = ManagedProperties.getProperty(newResourcName);
/** * This is an expensive operation. * ON EACH CALL it walks through all property lists * associated with the current context class loader upto * and including the bootstrap class loader. * * @return Returns a <code>java.util.Properties</code> instance * that is equivalent to the current state of the scoped * properties, in that getProperty() will return the same value. * However, this is a copy, so setProperty on the * returned value will not effect the scoped properties. */ public static Properties getProperties() { Properties p = new Properties(); Enumeration<String> names = propertyNames(); while (names.hasMoreElements()) { String name = names.nextElement(); p.put(name, getProperty(name)); } return p; }