public abstract class Vault extends Object
Since our code might be deployed in different environments, this class provides a deployment-neutral way of retrieving configuration properties.
Constructor and Description |
---|
Vault() |
Modifier and Type | Method and 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.
|
public static void setProperties(Properties properties)
properties
- a Properties
object.public static Properties getProperties()
Properties
object.public static String getProperty(String key)
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 system
File.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.
key
- The key name used to lookup the property path values.Copyright © 2021. All rights reserved.