public final class PropertiesLoader extends Object
karaf.home property
ddf.home property
If all strategies fail, then the returned Properties object will be empty.
| Modifier and Type | Method and Description |
|---|---|
static PropertiesLoader |
getInstance() |
Properties |
loadProperties(String propertiesFile)
Load properties from a file with no classloader specified.
|
Properties |
loadProperties(String propertiesFile,
ClassLoader classLoader)
Will attempt to load properties from a file using the given classloader.
|
<K,V> Map<K,V> |
toMap(Properties properties)
Converts an instance of Properties to an instance of a Map, which is the preferred API for
working with key-value collections.
|
public static PropertiesLoader getInstance()
public <K,V> Map<K,V> toMap(Properties properties)
K - the object type of the key in the returned mapV - the object type of the value in the returned mapproperties - the properties object whose elements should be in the resultant mappublic Properties loadProperties(String propertiesFile)
propertiesFile - the resource name or the file path of the properties filepublic Properties loadProperties(String propertiesFile, ClassLoader classLoader)
propertiesFile - the resource name or the file path of the properties fileclassLoader - the class loader with access to the properties fileThis work is licensed under a Creative Commons Attribution 4.0 International License.