edu.northwestern.at.utils

## Class PropertyUtils

- java.lang.Object
- - edu.northwestern.at.utils.PropertyUtils

-     public class PropertyUtils
      extends java.lang.Object

  Read and write properties files.

- - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `PropertyUtils()` Don't allow instantiation, do allow overrides.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static java.util.Properties` | `loadProperties(java.lang.String propertiesFileName)` Load properties from a specified file.
    `static java.util.Properties` | `loadProperties(java.net.URL propertiesURL)` Load properties from a specified URL.
    `static java.util.Properties` | `loadPropertiesFromString(java.lang.String propertiesString)` Load properties from a string.
    `static void` | `saveProperties(java.util.Properties properties, java.lang.String propertiesFileName, java.lang.String header)` Save properties to a specified file.
    `static void` | `savePropertiesToString(java.util.Properties properties, java.lang.String propertiesString, java.lang.String header)` Saves properties to a specified string.

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

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### PropertyUtils

          protected PropertyUtils()

      Don't allow instantiation, do allow overrides.

  - ### Method Detail

    - #### loadProperties

          public static java.util.Properties loadProperties(java.lang.String propertiesFileName)
                                                     throws java.io.IOException,
                                                            java.io.FileNotFoundException

      Load properties from a specified file.
      Parameters:
        `propertiesFileName` - File name of properties file to read.
      Returns:
        Properties object with keys and values as read from properties file.
      Throws:
        `java.io.FileNotFoundException` - if properties file not found.
        `java.io.IOException` - if properties file cannot be read.

    - #### loadProperties

          public static java.util.Properties loadProperties(java.net.URL propertiesURL)
                                                     throws java.io.IOException,
                                                            java.io.FileNotFoundException

      Load properties from a specified URL.
      Parameters:
        `propertiesURL` - URL of properties file to read.
      Returns:
        Properties object with keys and values as read from properties URL.
      Throws:
        `java.io.IOException` - if properties file cannot be read.
        `java.io.FileNotFoundException`

    - #### saveProperties

          public static void saveProperties(java.util.Properties properties,
                            java.lang.String propertiesFileName,
                            java.lang.String header)
                                     throws java.io.IOException

      Save properties to a specified file.
      Parameters:
        `properties` - Properties collection to save.
        `propertiesFileName` - Name of file to save to.
        `header` - Header line describing properties.
      Throws:
        `java.io.IOException` - if properties file cannot be saved.

    - #### loadPropertiesFromString

          public static java.util.Properties loadPropertiesFromString(java.lang.String propertiesString)
                                                               throws java.io.IOException

      Load properties from a string.
      Parameters:
        `propertiesString` - String containing properties to read.
      Returns:
        Properties object with keys and values as read from properties string.
      Throws:
        `java.io.IOException` - if properties cannot be read from string.

    - #### savePropertiesToString

          public static void savePropertiesToString(java.util.Properties properties,
                                    java.lang.String propertiesString,
                                    java.lang.String header)
                                             throws java.io.IOException

      Saves properties to a specified string.
      Parameters:
        `properties` - -- properties collection to save.
        `header` - -- header line describing properties.
      Throws:
        `java.io.IOException` - if properties cannot be saved to string.