Package helma.util

# Class SystemProperties

java.lang.Object
java.util.Dictionary<K,V>
java.util.Hashtable<Object,Object>
java.util.Properties
helma.util.SystemProperties

All Implemented Interfaces:
  `Serializable`, `Cloneable`, `Map<Object,Object>`

public final class SystemProperties extends 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

## Field Summary

### Fields inherited from class java.util.Properties

`defaults`

## Constructor Summary

Constructors
Constructor
Description
`SystemProperties()`
Construct 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 Type
Method
Description
`void`
`addProps(String key, InputStream in)`
Similar to load(), but adds to the existing properties instead of discarding them.
`boolean`
`contains(Object obj)`
Overrides method to act on the wrapped properties object.
`boolean`
`containsKey(Object key)`
Overrides method to act on the wrapped properties object.
`Enumeration`
`elements()`
Overrides method to act on the wrapped properties object.
`Object`
`get(Object key)`
Overrides method to act on the wrapped properties object.
`long`
`getChecksum()`
Return a checksum that changes when something in the properties changes.
`File`
`getFile()`
Get the properties file
`String`
`getProperty(String name)`
Overrides method to act on the wrapped properties object.
`String`
`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`
`isIgnoreCase()`
Returns true if this property map ignores key case
`Enumeration`
`keys()`
Overrides method to act on the wrapped properties object.
`Set`
`keySet()`
Overrides method to act on the wrapped properties object.
`long`
`lastModified()`
Return the modify-time of the underlying properties file.
`Object`
`put(Object key, Object value)`
`Object`
`remove(Object key)`
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.
`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`

### Methods inherited from class java.lang.Object

`finalize, getClass, notify, notifyAll, wait, wait, wait`

## Constructor Details

### SystemProperties

public SystemProperties()
Construct an empty properties object.

### SystemProperties

public SystemProperties(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(String filename, SystemProperties defaultProps)
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

public File getFile()
Get the properties file

Returns:
  the properties file

### addProps

public void addProps(String key, InputStream in) throws IOException
Similar to load(), but adds to the existing properties instead of discarding them.

Throws:
  `IOException`

### removeProps

public void removeProps(String key)
Remove an additional properties dictionary.

### put

public Object put(Object key, Object value)

Specified by:
  `put` in interface `Map<Object,Object>`
Overrides:
  `put` in class `Properties`

### get

public Object get(Object key)
Overrides method to act on the wrapped properties object.

Specified by:
  `get` in interface `Map<Object,Object>`
Overrides:
  `get` in class `Properties`

### remove

public Object remove(Object key)
Overrides method to act on the wrapped properties object.

Specified by:
  `remove` in interface `Map<Object,Object>`
Overrides:
  `remove` in class `Properties`

### contains

public boolean contains(Object obj)
Overrides method to act on the wrapped properties object.

Overrides:
  `contains` in class `Properties`

### containsKey

public boolean containsKey(Object key)
Overrides method to act on the wrapped properties object.

Specified by:
  `containsKey` in interface `Map<Object,Object>`
Overrides:
  `containsKey` in class `Properties`

### isEmpty

public boolean isEmpty()
Overrides method to act on the wrapped properties object.

Specified by:
  `isEmpty` in interface `Map<Object,Object>`
Overrides:
  `isEmpty` in class `Properties`

### getProperty

public String getProperty(String name)
Overrides method to act on the wrapped properties object.

Overrides:
  `getProperty` in class `Properties`

### getProperty

public String getProperty(String name, String defaultValue)
Overrides method to act on the wrapped properties object.

Overrides:
  `getProperty` in class `Properties`

### keys

public Enumeration keys()
Overrides method to act on the wrapped properties object.

Overrides:
  `keys` in class `Properties`

### keySet

public Set keySet()
Overrides method to act on the wrapped properties object.

Specified by:
  `keySet` in interface `Map<Object,Object>`
Overrides:
  `keySet` in class `Properties`

### elements

public Enumeration elements()
Overrides method to act on the wrapped properties object.

Overrides:
  `elements` in class `Properties`

### size

public int size()
Overrides method to act on the wrapped properties object.

Specified by:
  `size` in interface `Map<Object,Object>`
Overrides:
  `size` in class `Properties`

### toString

public String toString()
Overrides method to act on the wrapped properties object.

Overrides:
  `toString` in class `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