com.darwinsys.util
Class FileProperties
java.lang.Object
|
+--java.util.Dictionary
|
+--java.util.Hashtable
|
+--java.util.Properties
|
+--com.darwinsys.util.FileProperties
- public class FileProperties
- extends java.util.Properties
The FileProperties class extends Properties,
"a persistent set of properties [that] can be saved to a stream
or loaded from a stream". This subclass attends to all the mundane
details of opening the Stream(s) for actually saving and loading
the Properties.
This subclass preserves the useful feature that
a property list can contain another property list as its
"defaults"; this second property list is searched if
the property key is not found in the original property list.
- See Also:
- Serialized Form
|
Field Summary |
protected java.lang.String |
fileName
|
protected java.io.InputStream |
inStr
The InputStream for loading |
protected java.io.OutputStream |
outStr
The OutputStream for loading |
| Fields inherited from class java.util.Properties |
defaults |
|
Constructor Summary |
FileProperties(java.lang.String loadsaveFileName)
Construct a FileProperties given a fileName. |
FileProperties(java.lang.String loadsaveFileName,
java.util.Properties defProp)
Construct a FileProperties given a fileName and
a list of default properties. |
|
Method Summary |
void |
close()
|
void |
load()
Load the properties from the saved filename. |
void |
save()
Save the properties for later loading. |
| Methods inherited from class java.util.Properties |
getProperty,
getProperty,
list,
list,
load,
propertyNames,
save,
setProperty,
store |
TR BGCOLOR="#EEEEFF" ID="TableSubHeadingColor">
| 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 |
fileName
protected java.lang.String fileName
inStr
protected java.io.InputStream inStr
- The InputStream for loading
outStr
protected java.io.OutputStream outStr
- The OutputStream for loading
FileProperties
public FileProperties(java.lang.String loadsaveFileName)
throws java.io.IOException
- Construct a FileProperties given a fileName.
FileProperties
public FileProperties(java.lang.String loadsaveFileName,
java.util.Properties defProp)
throws java.io.IOException
- Construct a FileProperties given a fileName and
a list of default properties.
load
public void load()
throws java.io.IOException
- Load the properties from the saved filename.
If that fails, try again, tacking on the .properties extension
save
public void save()
throws java.io.IOException
- Save the properties for later loading.
close
public void close()