com.atlassian.crowd.util
Class PropertyUtils

java.lang.Object
  extended by com.atlassian.crowd.util.PropertyUtils

public class PropertyUtils
extends Object

PropertyUtils class to enable the writing back of Properties


Constructor Summary
PropertyUtils()
           
 
Method Summary
 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertyUtils

public PropertyUtils()
Method Detail

getProperties

public Properties getProperties(String propertyResourceLocation)
Retrieves the properties from the specified properties file

Parameters:
propertyResourceLocation - location of the properties file
Returns:
Properties retrieved from the properties file specified

getPropertiesFromStream

public Properties getPropertiesFromStream(InputStream is)
Loads Properties from an InputStream

Parameters:
is - InputStream containing properties to load
Returns:
Properties loaded from input stream

removeProperty

public boolean removeProperty(String propertyResourceLocation,
                              String key)
Removes the specified property from the specified property file

Parameters:
propertyResourceLocation - location of the properties file
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

public void updateProperty(String propertyResourceLocation,
                           String key,
                           String value)
Updates the specified properties file with the specified key/value property

Parameters:
propertyResourceLocation - location of the properties file
key - the key for the property to be added/updated
value - the value of the property to be added/updated


Copyright © 2013 Atlassian. All Rights Reserved.