Package com.atlassian.crowd.util
Class PropertyUtils
java.lang.Object
com.atlassian.crowd.util.PropertyUtils
PropertyUtils class to enable the writing back of Properties
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetProperties
(String propertyResourceLocation) Retrieves the properties from the specified properties fileLoads Properties from an InputStreamboolean
removeProperty
(String propertyResourceLocation, String key) Removes the specified property from the specified property filevoid
updateProperty
(String propertyResourceLocation, String key, String value) Updates the specified properties file with the specified key/value property
-
Constructor Details
-
PropertyUtils
public PropertyUtils()
-
-
Method Details
-
getProperties
Retrieves the properties from the specified properties file- Parameters:
propertyResourceLocation
- location of the properties file- Returns:
- Properties retrieved from the properties file specified
-
getPropertiesFromStream
Loads Properties from an InputStream- Parameters:
is
- InputStream containing properties to load- Returns:
- Properties loaded from input stream
-
removeProperty
Removes the specified property from the specified property file- Parameters:
propertyResourceLocation
- location of the properties file. This location is assumed to be a safe file path.key
- the key of the property to be removed- Returns:
true
iff the specified property has been successfully removed from the properties file;false
otherwise
-
updateProperty
Updates the specified properties file with the specified key/value property- Parameters:
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/updated
-