Class Vault
- java.lang.Object
-
- org.opennms.core.resource.Vault
-
public abstract class Vault extends Object
The Vault stores application configuration properties.Since our code might be deployed in different environments, this class provides a deployment-neutral way of retrieving configuration properties.
- Author:
- Lawrence Karnowski , Brian Weaver
-
-
Constructor Summary
Constructors Constructor Description Vault()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Properties
getProperties()
Return the entire set of application configuration properties.static String
getProperty(String key)
Return property from the configuration parameter list.static void
setProperties(Properties properties)
Set the application configuration properties.static boolean
supplementSystemPropertiesFromKey(String key)
Adds new keys to the system properties using the passed key name a the properties location instance.
-
-
-
Method Detail
-
setProperties
public static void setProperties(Properties properties)
Set the application configuration properties.- Parameters:
properties
- aProperties
object.
-
getProperties
public static Properties getProperties()
Return the entire set of application configuration properties.- Returns:
- a
Properties
object.
-
getProperty
public static String getProperty(String key)
Return property from the configuration parameter list.
-
supplementSystemPropertiesFromKey
public static boolean supplementSystemPropertiesFromKey(String key)
Adds new keys to the system properties using the passed key name a the properties location instance. The passed key is used as a key to the system
Properties.getProperty(java.lang.String)
to find the supplementary property information. The returned value should be in the form of a list of file names, each separated by the systemFile.pathSeparator
character.Once the list of files is recovered, each file is visited and loaded into the system properties. If any file cannot be loaded due to an I/O error then it is skipped as a whole. No partial key sets are loaded into the system properties. Also, this method will not overwrite an existing key in the currently loaded properties.
- Parameters:
key
- The key name used to lookup the property path values.- Returns:
- True if all properties loaded correctly, false if any property file failed to load.
-
-