Package helma.util
Class SystemProperties
- All Implemented Interfaces:
Serializable
,Cloneable
,Map<Object,
Object>
A property dictionary that is updated from a property file each time the
file is modified. It is also case insensitive.
- See Also:
-
Field Summary
Fields inherited from class java.util.Properties
defaults
-
Constructor Summary
ConstructorsConstructorDescriptionConstruct an empty properties object.SystemProperties
(SystemProperties defaultProps) Contstruct a properties object with the given default properties.SystemProperties
(String filename) Construct a properties object from a properties file.SystemProperties
(String filename, SystemProperties defaultProps) Construct a properties object from a file name with the given default properties (ignoring case) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addProps
(String key, InputStream in) Similar to load(), but adds to the existing properties instead of discarding them.boolean
Overrides method to act on the wrapped properties object.boolean
containsKey
(Object key) Overrides method to act on the wrapped properties object.elements()
Overrides method to act on the wrapped properties object.Overrides method to act on the wrapped properties object.long
Return a checksum that changes when something in the properties changes.getFile()
Get the properties filegetProperty
(String name) Overrides method to act on the wrapped properties object.getProperty
(String name, String defaultValue) Overrides method to act on the wrapped properties object.boolean
isEmpty()
Overrides method to act on the wrapped properties object.boolean
Returns true if this property map ignores key casekeys()
Overrides method to act on the wrapped properties object.keySet()
Overrides method to act on the wrapped properties object.long
Return the modify-time of the underlying properties file.Overrides method to act on the wrapped properties object.void
removeProps
(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.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 Details
-
SystemProperties
public SystemProperties()Construct an empty properties object. -
SystemProperties
Construct a properties object from a properties file. -
SystemProperties
Contstruct a properties object with the given default properties. -
SystemProperties
Construct a properties object from a file name with the given default properties (ignoring case)
-
-
Method Details
-
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
Get the properties file- Returns:
- the properties file
-
addProps
Similar to load(), but adds to the existing properties instead of discarding them.- Throws:
IOException
-
removeProps
Remove an additional properties dictionary. -
put
-
get
Overrides method to act on the wrapped properties object. -
remove
Overrides method to act on the wrapped properties object. -
contains
Overrides method to act on the wrapped properties object.- Overrides:
contains
in classProperties
-
containsKey
Overrides method to act on the wrapped properties object.- Specified by:
containsKey
in interfaceMap<Object,
Object> - Overrides:
containsKey
in classProperties
-
isEmpty
public boolean isEmpty()Overrides method to act on the wrapped properties object. -
getProperty
Overrides method to act on the wrapped properties object.- Overrides:
getProperty
in classProperties
-
getProperty
Overrides method to act on the wrapped properties object.- Overrides:
getProperty
in classProperties
-
keys
Overrides method to act on the wrapped properties object.- Overrides:
keys
in classProperties
-
keySet
Overrides method to act on the wrapped properties object. -
elements
Overrides method to act on the wrapped properties object.- Overrides:
elements
in classProperties
-
size
public int size()Overrides method to act on the wrapped properties object. -
toString
Overrides method to act on the wrapped properties object.- Overrides:
toString
in classProperties
-
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
-