Package helma.util
Class SystemProperties
- java.lang.Object
-
- java.util.Dictionary<K,V>
-
- java.util.Hashtable<java.lang.Object,java.lang.Object>
-
- java.util.Properties
-
- helma.util.SystemProperties
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,java.util.Map<java.lang.Object,java.lang.Object>
public final class SystemProperties extends java.util.Properties
A property dictionary that is updated from a property file each time the file is modified. It is also case insensitive.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SystemProperties()
Construct an empty properties object.SystemProperties(SystemProperties defaultProps)
Contstruct a properties object with the given default properties.SystemProperties(java.lang.String filename)
Construct a properties object from a properties file.SystemProperties(java.lang.String filename, SystemProperties defaultProps)
Construct a properties object from a file name with the given default properties (ignoring case)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addProps(java.lang.String key, java.io.InputStream in)
Similar to load(), but adds to the existing properties instead of discarding them.boolean
contains(java.lang.Object obj)
Overrides method to act on the wrapped properties object.boolean
containsKey(java.lang.Object key)
Overrides method to act on the wrapped properties object.java.util.Enumeration
elements()
Overrides method to act on the wrapped properties object.java.lang.Object
get(java.lang.Object key)
Overrides method to act on the wrapped properties object.long
getChecksum()
Return a checksum that changes when something in the properties changes.java.io.File
getFile()
Get the properties filejava.lang.String
getProperty(java.lang.String name)
Overrides method to act on the wrapped properties object.java.lang.String
getProperty(java.lang.String name, java.lang.String defaultValue)
Overrides method to act on the wrapped properties object.boolean
isEmpty()
Overrides method to act on the wrapped properties object.boolean
isIgnoreCase()
Returns true if this property map ignores key casejava.util.Enumeration
keys()
Overrides method to act on the wrapped properties object.java.util.Set
keySet()
Overrides method to act on the wrapped properties object.long
lastModified()
Return the modify-time of the underlying properties file.java.lang.Object
put(java.lang.Object key, java.lang.Object value)
java.lang.Object
remove(java.lang.Object key)
Overrides method to act on the wrapped properties object.void
removeProps(java.lang.String key)
Remove an additional properties dictionary.void
setIgnoreCase(boolean ignore)
Turns case sensitivity for keys in this Map on or off.int
size()
Overrides method to act on the wrapped properties object.java.lang.String
toString()
Overrides method to act on the wrapped properties object.void
update()
Update/re-read the properties from file if necessary.-
Methods inherited from class java.util.Properties
clear, clone, compute, computeIfAbsent, computeIfPresent, containsValue, entrySet, equals, forEach, getOrDefault, hashCode, list, list, load, load, loadFromXML, merge, propertyNames, putAll, putIfAbsent, rehash, remove, replace, replace, replaceAll, save, setProperty, store, store, storeToXML, storeToXML, storeToXML, stringPropertyNames, values
-
-
-
-
Constructor Detail
-
SystemProperties
public SystemProperties()
Construct an empty properties object.
-
SystemProperties
public SystemProperties(java.lang.String filename)
Construct a properties object from a properties file.
-
SystemProperties
public SystemProperties(SystemProperties defaultProps)
Contstruct a properties object with the given default properties.
-
SystemProperties
public SystemProperties(java.lang.String filename, SystemProperties defaultProps)
Construct a properties object from a file name with the given default properties (ignoring case)
-
-
Method Detail
-
lastModified
public long lastModified()
Return the modify-time of the underlying properties file.
-
update
public void update()
Update/re-read the properties from file if necessary.
-
getChecksum
public long getChecksum()
Return a checksum that changes when something in the properties changes.
-
getFile
public java.io.File getFile()
Get the properties file- Returns:
- the properties file
-
addProps
public void addProps(java.lang.String key, java.io.InputStream in) throws java.io.IOException
Similar to load(), but adds to the existing properties instead of discarding them.- Throws:
java.io.IOException
-
removeProps
public void removeProps(java.lang.String key)
Remove an additional properties dictionary.
-
put
public java.lang.Object put(java.lang.Object key, java.lang.Object value)
- Specified by:
put
in interfacejava.util.Map<java.lang.Object,java.lang.Object>
- Overrides:
put
in classjava.util.Properties
-
get
public java.lang.Object get(java.lang.Object key)
Overrides method to act on the wrapped properties object.- Specified by:
get
in interfacejava.util.Map<java.lang.Object,java.lang.Object>
- Overrides:
get
in classjava.util.Properties
-
remove
public java.lang.Object remove(java.lang.Object key)
Overrides method to act on the wrapped properties object.- Specified by:
remove
in interfacejava.util.Map<java.lang.Object,java.lang.Object>
- Overrides:
remove
in classjava.util.Properties
-
contains
public boolean contains(java.lang.Object obj)
Overrides method to act on the wrapped properties object.- Overrides:
contains
in classjava.util.Properties
-
containsKey
public boolean containsKey(java.lang.Object key)
Overrides method to act on the wrapped properties object.- Specified by:
containsKey
in interfacejava.util.Map<java.lang.Object,java.lang.Object>
- Overrides:
containsKey
in classjava.util.Properties
-
isEmpty
public boolean isEmpty()
Overrides method to act on the wrapped properties object.- Specified by:
isEmpty
in interfacejava.util.Map<java.lang.Object,java.lang.Object>
- Overrides:
isEmpty
in classjava.util.Properties
-
getProperty
public java.lang.String getProperty(java.lang.String name)
Overrides method to act on the wrapped properties object.- Overrides:
getProperty
in classjava.util.Properties
-
getProperty
public java.lang.String getProperty(java.lang.String name, java.lang.String defaultValue)
Overrides method to act on the wrapped properties object.- Overrides:
getProperty
in classjava.util.Properties
-
keys
public java.util.Enumeration keys()
Overrides method to act on the wrapped properties object.- Overrides:
keys
in classjava.util.Properties
-
keySet
public java.util.Set keySet()
Overrides method to act on the wrapped properties object.- Specified by:
keySet
in interfacejava.util.Map<java.lang.Object,java.lang.Object>
- Overrides:
keySet
in classjava.util.Properties
-
elements
public java.util.Enumeration elements()
Overrides method to act on the wrapped properties object.- Overrides:
elements
in classjava.util.Properties
-
size
public int size()
Overrides method to act on the wrapped properties object.- Specified by:
size
in interfacejava.util.Map<java.lang.Object,java.lang.Object>
- Overrides:
size
in classjava.util.Properties
-
toString
public java.lang.String toString()
Overrides method to act on the wrapped properties object.- Overrides:
toString
in classjava.util.Properties
-
setIgnoreCase
public void setIgnoreCase(boolean ignore)
Turns case sensitivity for keys in this Map on or off.
-
isIgnoreCase
public boolean isIgnoreCase()
Returns true if this property map ignores key case
-
-