public class PropertiesManager extends Object
| Modifier and Type | Field and Description |
|---|---|
Properties |
properties |
String |
propertiesFilePath |
| Constructor and Description |
|---|
PropertiesManager()
Default constructor.
|
PropertiesManager(Properties properties)
Default constructor.
|
PropertiesManager(String propertiesFilePath)
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
Properties |
getPropertiesObject()
Get the properties object for the instance of this class.
|
String |
getProperty(String propertyName)
Get a property value by its name.
|
void |
removeProperty(String propertyName)
Remove a property by its name.
|
void |
setProperty(String propertyName,
String propvalue)
Set a property value by its name.
|
void |
storeProperties()
Store new properties and values in the properties file.
|
void |
storeProperties(String propertiesFilePath)
Store new properties and values in the properties file.
|
static String |
string2Property(String originalValue)
Convert a standard string to a property-compatible string.
|
public Properties properties
public String propertiesFilePath
public PropertiesManager()
public PropertiesManager(String propertiesFilePath)
propertiesFilePath - The filesystem path from the file is loaded.public PropertiesManager(Properties properties)
properties - The properties object used to define base properties.public String getProperty(String propertyName)
propertyName - The property name to get its value.public void setProperty(String propertyName, String propvalue)
propertyName - The property name to set.propvalue - The property value to set.public void removeProperty(String propertyName)
propertyName - The property name to remove.public void storeProperties()
public void storeProperties(String propertiesFilePath)
propertiesFilePath - The filesystem path where the file is saved.public Properties getPropertiesObject()
Copyright © 2004–2020 Jahia Solutions Group SA. All rights reserved.