jwo.utils
Class SecureProperties

java.lang.Object
  extended by java.util.Dictionary<K,V>
      extended by java.util.Hashtable<Object,Object>
          extended by java.util.Properties
              extended by jwo.utils.SecureProperties
All Implemented Interfaces:
Serializable, Cloneable, Map<Object,Object>

public class SecureProperties
extends Properties

Stores an encrypted version of a properties hashtable.

Version:
2.3, 4th October, 2007
Author:
Jo Wood.
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.Properties
defaults
 
Constructor Summary
SecureProperties()
          Creates an empty and unencrypted property list with no default values.
SecureProperties(byte key)
          Creates an empty property list with no default values.
SecureProperties(Properties defaults)
          Creates an empty and unencrypted property list with the specified defaults.
SecureProperties(Properties defaults, byte key)
          Creates an empty property list with the specified defaults and key.
 
Method Summary
 void load(InputStream inStream)
          Reads a property list (key and element pairs) from the input stream.
 void store(OutputStream out, String header)
          Writes this property list (key and element pairs) in this Properties table to the output stream in a format suitable for loading into a Properties table using the load method.
 
Methods inherited from class java.util.Properties
getProperty, getProperty, list, list, loadFromXML, propertyNames, save, setProperty, storeToXML, storeToXML
 
Methods inherited from class java.util.Hashtable
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, rehash, remove, size, toString, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SecureProperties

public SecureProperties()
Creates an empty and unencrypted property list with no default values.


SecureProperties

public SecureProperties(byte key)
Creates an empty property list with no default values.

Parameters:
key - Key for encryption.

SecureProperties

public SecureProperties(Properties defaults)
Creates an empty and unencrypted property list with the specified defaults.

Parameters:
defaults - Default properties.

SecureProperties

public SecureProperties(Properties defaults,
                        byte key)
Creates an empty property list with the specified defaults and key.

Parameters:
defaults - Default properties.
key - Key used to create encryption.
Method Detail

store

public void store(OutputStream out,
                  String header)
Writes this property list (key and element pairs) in this Properties table to the output stream in a format suitable for loading into a Properties table using the load method.

Overrides:
store in class Properties
Parameters:
out - an output stream.
header - a description of the property list.

load

public void load(InputStream inStream)
Reads a property list (key and element pairs) from the input stream. The stream is assumed to be using the ISO 8859-1 character encoding.

Overrides:
load in class Properties
Parameters:
inStream - Input stream containing property list.


Copyright Jo Wood, 1996-2009, last modified, 17th April, 2009