com.carlosbcruz.util
Class PropertiesController

java.lang.Object
  extended by com.carlosbcruz.util.PropertiesController

public class PropertiesController
extends java.lang.Object

Utility class to help retrieving application properties


Constructor Summary
PropertiesController()
           
 
Method Summary
static java.lang.String getStringProperty(java.lang.String propertyKey)
          Get the property to a key.
static java.lang.String getStringPropertyWithDefault(java.lang.String propertyKey, java.lang.String defaultValue)
          Retrieve the property.
static void loadProperties()
          Load the default properties
static void nukeProperties()
          Clear the properties file
static void removeProperty(java.lang.String propertyKey)
          Remove a property
static void saveProperties()
          Save the properties in the application file
static void setStringProperty(java.lang.String propertyKey, java.lang.String propertyValue)
          Set an Account property
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertiesController

public PropertiesController()
Method Detail

nukeProperties

public static void nukeProperties()
Clear the properties file


loadProperties

public static void loadProperties()
Load the default properties


getStringProperty

public static java.lang.String getStringProperty(java.lang.String propertyKey)
Get the property to a key. A default value is returned if not found

Parameters:
propertyKey - The parameter key
Returns:
the value

getStringPropertyWithDefault

public static java.lang.String getStringPropertyWithDefault(java.lang.String propertyKey,
                                                            java.lang.String defaultValue)
Retrieve the property. If the property do not exist return the default

Parameters:
propertyKey - The parameter key
defaultValue - The default value
Returns:
the property

removeProperty

public static void removeProperty(java.lang.String propertyKey)
Remove a property

Parameters:
propertyKey -

setStringProperty

public static void setStringProperty(java.lang.String propertyKey,
                                     java.lang.String propertyValue)
Set an Account property

Parameters:
propertyKey - the Key
propertyValue - the Value

saveProperties

public static void saveProperties()
Save the properties in the application file