Class FilePropertyMgr

java.lang.Object
fc.util.PropertyMgr
fc.util.FilePropertyMgr

public class FilePropertyMgr extends PropertyMgr
Loads properties from a file. Trims whitespace from property values, in contrast to (
invalid reference
java.util.Property
does not trim whitespace from values, so "x = y " will return "y ", which is hard to debug).

ThreadSafety: This class is thread safe and can be used by multiple threads concurrently.

Version:
1.1 5/31/2002
  • Constructor Details

  • Method Details

    • get

      public String get(String name)
      Description copied from class: PropertyMgr
      Returns the property associated with the specified key or null if the property was not found.
      Specified by:
      get in class PropertyMgr
      Parameters:
      name - the property key
    • set

      public String set(String name, String value)
      Description copied from class: PropertyMgr
      Sets the property associated with the specified key.
      Specified by:
      set in class PropertyMgr
      Parameters:
      name - the property key
      value - the property value
      Returns:
      the previous value of the specified key or null if it did not have one.
    • save

      public void save() throws IOException
      Description copied from class: PropertyMgr
      Saves any properties that were set previously. This method does not need to be called if properties were only read, however if any property was modified or added, it is essential to call this method to save any such changes.
      Specified by:
      save in class PropertyMgr
      Throws:
      IOException
    • toString

      public String toString()
      Returns a description but the exact details of said description are unspecified and subject to change. However, the following may be regarded as typical: [getClass().getName()] contains the following properties:
      [List of properties]
      Overrides:
      toString in class Object
    • main

      public static void main(String[] args)