public class ConfigurationUtils
extends java.lang.Object
| Constructor and Description |
|---|
ConfigurationUtils() |
| Modifier and Type | Method and Description |
|---|---|
static ConcurrentCompositeConfiguration |
convertToConcurrentCompositeConfiguration(org.apache.commons.configuration.CombinedConfiguration config)
Convert CombinedConfiguration into
ConcurrentCompositeConfiguration as the later has better performance
and thread safety. |
static void |
copyProperties(org.apache.commons.configuration.Configuration from,
org.apache.commons.configuration.Configuration to) |
static java.util.Map<java.lang.String,org.apache.commons.configuration.Configuration> |
getAllNamedConfiguration(org.apache.commons.configuration.Configuration conf)
Gets all named sub-configuration from a configuration in a map.
|
static org.apache.commons.configuration.AbstractConfiguration |
getConfigFromPropertiesFile(java.net.URL startingUrl,
java.util.Set<java.lang.String> loaded,
java.lang.String... nextLoadKeys) |
static java.util.Properties |
getProperties(org.apache.commons.configuration.Configuration config)
Utility method to obtain
Properties given an instance of AbstractConfiguration. |
static java.util.Properties |
getPropertiesFromFile(java.net.URL startingUrl,
java.util.Set<java.lang.String> loaded,
java.lang.String... nextLoadKeys) |
static void |
loadProperties(java.util.Properties props,
org.apache.commons.configuration.Configuration config) |
public static ConcurrentCompositeConfiguration convertToConcurrentCompositeConfiguration(org.apache.commons.configuration.CombinedConfiguration config)
ConcurrentCompositeConfiguration as the later has better performance
and thread safety.config - Configuration to be convertedpublic static java.util.Map<java.lang.String,org.apache.commons.configuration.Configuration> getAllNamedConfiguration(org.apache.commons.configuration.Configuration conf)
ConcurrentCompositeConfiguration or CombinedConfiguration and extract the
named configurations out of them.conf - Configuration to get all the named sub-configurationspublic static java.util.Properties getProperties(org.apache.commons.configuration.Configuration config)
Properties given an instance of AbstractConfiguration.
Returns an empty Properties object if the config has no properties or is null.config - Configuration to get the propertiespublic static void loadProperties(java.util.Properties props,
org.apache.commons.configuration.Configuration config)
public static org.apache.commons.configuration.AbstractConfiguration getConfigFromPropertiesFile(java.net.URL startingUrl,
java.util.Set<java.lang.String> loaded,
java.lang.String... nextLoadKeys)
throws java.io.FileNotFoundException
java.io.FileNotFoundExceptionpublic static void copyProperties(org.apache.commons.configuration.Configuration from,
org.apache.commons.configuration.Configuration to)
public static java.util.Properties getPropertiesFromFile(java.net.URL startingUrl,
java.util.Set<java.lang.String> loaded,
java.lang.String... nextLoadKeys)
throws java.io.FileNotFoundException
java.io.FileNotFoundException