org.vfny.geoserver.control.internal
Class PropertyPreferenceStoreStrategy

java.lang.Object
  extended by org.vfny.geoserver.control.internal.PropertyPreferenceStoreStrategy
All Implemented Interfaces:
IPreferenceStoreStrategy

public class PropertyPreferenceStoreStrategy
extends java.lang.Object
implements IPreferenceStoreStrategy

Implementation backing onto a properties file.

Author:
Jesse

Constructor Summary
PropertyPreferenceStoreStrategy(java.util.Properties properties)
           
PropertyPreferenceStoreStrategy(java.lang.String propertiesFile)
           
 
Method Summary
 void flush()
           
 java.lang.String get(java.lang.String key)
          Gets the value of the preference
 java.lang.String[] keys()
          Returns all the keys of the existing preferences
 void put(java.lang.String key, java.lang.String value)
          Sets the prefence
 void setValidator(IValidator validator)
          Sets the validator that this strategy uses.
 void unset(java.lang.String key)
          Clears the preference so the default is used.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertyPreferenceStoreStrategy

public PropertyPreferenceStoreStrategy(java.lang.String propertiesFile)
                                throws java.io.IOException
Throws:
java.io.IOException

PropertyPreferenceStoreStrategy

public PropertyPreferenceStoreStrategy(java.util.Properties properties)
Method Detail

get

public java.lang.String get(java.lang.String key)
Description copied from interface: IPreferenceStoreStrategy
Gets the value of the preference

Specified by:
get in interface IPreferenceStoreStrategy
Parameters:
key - preference key
Returns:
the value

put

public void put(java.lang.String key,
                java.lang.String value)
Description copied from interface: IPreferenceStoreStrategy
Sets the prefence

Specified by:
put in interface IPreferenceStoreStrategy
Parameters:
key - the preference key
value - the new value.

flush

public void flush()
           throws java.io.IOException
Throws:
java.io.IOException

unset

public void unset(java.lang.String key)
Description copied from interface: IPreferenceStoreStrategy
Clears the preference so the default is used.

Specified by:
unset in interface IPreferenceStoreStrategy
Parameters:
key - the preference key;

keys

public java.lang.String[] keys()
Description copied from interface: IPreferenceStoreStrategy
Returns all the keys of the existing preferences

Specified by:
keys in interface IPreferenceStoreStrategy
Returns:
all the keys of the existing preferences

setValidator

public void setValidator(IValidator validator)
Description copied from interface: IPreferenceStoreStrategy
Sets the validator that this strategy uses.

Specified by:
setValidator in interface IPreferenceStoreStrategy
Parameters:
validator - new validator.