org.eigenbase.util.property
Class PersistentPropertyStorage
java.lang.Object
org.eigenbase.util.property.PersistentPropertyStorage
class PersistentPropertyStorage
- extends Object
PersistentPropertyStorage handles storage for persistent property objects.
For example, see PersistentStringProperty
.
- Since:
- December 3, 2004
- Version:
- $Id: //open/dev/farrago/src/org/eigenbase/util/property/PersistentPropertyStorage.java#11 $
- Author:
- stephan
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
propertyFileMap
private static final HashMap propertyFileMap
propertyFile
private File propertyFile
PersistentPropertyStorage
private PersistentPropertyStorage(File propertyFile)
- Creates a PersistentPropertyStorage for the given property file.
- Parameters:
propertyFile
- the name of the property file to use
newPersistentPropertyStorage
static PersistentPropertyStorage newPersistentPropertyStorage(String propertyFile)
throws IOException
- Factory method for PersistentPropertyStorage. Guarantees that only a
single PersistentPropertyStorage object exists for any property file.
- Parameters:
propertyFile
- the name of the property file to use
- Throws:
IOException
- if propertyFile
cannot be converted into
a canonical path name (via File.getCanonicalPath()
).
storeProperty
void storeProperty(Property property)
throws IOException
- Stores the given property's value in the property file. Unlike
Properties.store(java.io.OutputStream, String)
this method
does not obliterate the format of the existing property file.
- Parameters:
property
- a Property
value to store.
- Throws:
IOException
- if a temporary file cannot be created (File.createTempFile(String, String)
) or written, or if the property file
given during construction cannot be created (if it didn't already exist)
or written.
writePropertyValue
private void writePropertyValue(Writer writer,
Property property)
throws IOException
- Throws:
IOException