com.gridsystems.utils
Class SortedFileProperties

java.lang.Object
  extended by java.util.Dictionary<K,V>
      extended by java.util.Hashtable<java.lang.Object,java.lang.Object>
          extended by java.util.Properties
              extended by com.gridsystems.utils.FileProperties
                  extended by com.gridsystems.utils.SecureFileProperties
                      extended by com.gridsystems.utils.SortedFileProperties
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.util.Map<java.lang.Object,java.lang.Object>

public class SortedFileProperties
extends SecureFileProperties

This class implements a SecureProperties object linked to a File object. Changes in the file will be automatically updated, and changes in the object will produce changes in the file.

Version:
1.0
Author:
Luis Gaspart
See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.gridsystems.utils.FileProperties
f, header, lastModified, lockWrite, synchronize, ts
 
Fields inherited from class java.util.Properties
defaults
 
Constructor Summary
SortedFileProperties(java.io.File f)
          Creates a new instance.
SortedFileProperties(java.io.File f, java.util.Properties defaults)
          Creates a new instance.
 
Method Summary
 void commit()
          Propagates changes in memory to the file associated with this object.
 void store(java.io.OutputStream out, java.lang.String header)
          
 
Methods inherited from class com.gridsystems.utils.SecureFileProperties
load
 
Methods inherited from class com.gridsystems.utils.FileProperties
getBoolProperty, getIntProperty, getIntProperty, getLongProperty, getLongProperty, getProperty, getProperty, lockWrites, propertyNames, setFile, setHeader, setProperty, sync, unlockWrites
 
Methods inherited from class java.util.Properties
list, list, load, loadFromXML, save, store, storeToXML, storeToXML, stringPropertyNames
 
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

SortedFileProperties

public SortedFileProperties(java.io.File f,
                            java.util.Properties defaults)
Creates a new instance.

Parameters:
f - The file to link this instance to
defaults - The default values

SortedFileProperties

public SortedFileProperties(java.io.File f)
Creates a new instance.

Parameters:
f - The file to link this instance to
Method Detail

commit

public void commit()
Propagates changes in memory to the file associated with this object.

Overrides:
commit in class SecureFileProperties

store

public void store(java.io.OutputStream out,
                  java.lang.String header)
           throws java.io.IOException

Overrides:
store in class java.util.Properties
Throws:
java.io.IOException


Copyright © 2007-2008 Grid Systems, S.A.. All Rights Reserved.