Package helma.util

Class 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
    • 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​(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 file
      java.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 case
      java.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
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
    • 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 interface java.util.Map<java.lang.Object,​java.lang.Object>
        Overrides:
        put in class java.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 interface java.util.Map<java.lang.Object,​java.lang.Object>
        Overrides:
        get in class java.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 interface java.util.Map<java.lang.Object,​java.lang.Object>
        Overrides:
        remove in class java.util.Properties
      • contains

        public boolean contains​(java.lang.Object obj)
        Overrides method to act on the wrapped properties object.
        Overrides:
        contains in class java.util.Properties
      • containsKey

        public boolean containsKey​(java.lang.Object key)
        Overrides method to act on the wrapped properties object.
        Specified by:
        containsKey in interface java.util.Map<java.lang.Object,​java.lang.Object>
        Overrides:
        containsKey in class java.util.Properties
      • isEmpty

        public boolean isEmpty()
        Overrides method to act on the wrapped properties object.
        Specified by:
        isEmpty in interface java.util.Map<java.lang.Object,​java.lang.Object>
        Overrides:
        isEmpty in class java.util.Properties
      • getProperty

        public java.lang.String getProperty​(java.lang.String name)
        Overrides method to act on the wrapped properties object.
        Overrides:
        getProperty in class java.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 class java.util.Properties
      • keys

        public java.util.Enumeration keys()
        Overrides method to act on the wrapped properties object.
        Overrides:
        keys in class java.util.Properties
      • keySet

        public java.util.Set keySet()
        Overrides method to act on the wrapped properties object.
        Specified by:
        keySet in interface java.util.Map<java.lang.Object,​java.lang.Object>
        Overrides:
        keySet in class java.util.Properties
      • elements

        public java.util.Enumeration elements()
        Overrides method to act on the wrapped properties object.
        Overrides:
        elements in class java.util.Properties
      • size

        public int size()
        Overrides method to act on the wrapped properties object.
        Specified by:
        size in interface java.util.Map<java.lang.Object,​java.lang.Object>
        Overrides:
        size in class java.util.Properties
      • toString

        public java.lang.String toString()
        Overrides method to act on the wrapped properties object.
        Overrides:
        toString in class java.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