public class PropertyUtils extends Object
Constructor and Description |
---|
PropertyUtils() |
Modifier and Type | Method and Description |
---|---|
Properties |
getProperties(String propertyResourceLocation)
Retrieves the properties from the specified properties file
|
Properties |
getPropertiesFromStream(InputStream is)
Loads Properties from an InputStream
|
boolean |
removeProperty(String propertyResourceLocation,
String key)
Removes the specified property from the specified property file
|
void |
updateProperty(String propertyResourceLocation,
String key,
String value)
Updates the specified properties file with the specified key/value property
|
public Properties getProperties(String propertyResourceLocation)
propertyResourceLocation
- location of the properties filepublic Properties getPropertiesFromStream(InputStream is)
is
- InputStream containing properties to loadpublic boolean removeProperty(String propertyResourceLocation, String key)
propertyResourceLocation
- location of the properties file. This location is assumed to be a safe file path.key
- the key of the property to be removedtrue
iff the specified property has been successfully removed from the properties file; false
otherwisepublic void updateProperty(String propertyResourceLocation, String key, String value)
propertyResourceLocation
- location of the properties file. This location is assumed to be a safe file path.key
- the key for the property to be added/updatedvalue
- the value of the property to be added/updatedCopyright © 2020 Atlassian. All rights reserved.