Class PropertiesLoaderUtils

java.lang.Object
com.aspectran.utils.PropertiesLoaderUtils

public abstract class PropertiesLoaderUtils extends Object
Convenient utility methods for loading of java.util.Properties, performing standard handling of input streams.
  • Constructor Details

    • PropertiesLoaderUtils

      public PropertiesLoaderUtils()
  • Method Details

    • loadProperties

      public static Properties loadProperties(String resourceName) throws IOException
      Load all properties from the specified class path resource (in ISO-8859-1 encoding), using the default class loader.

      Merges properties if more than one resource of the same name found in the class path.

      Parameters:
      resourceName - the name of the class path resource
      Returns:
      the Properties instance
      Throws:
      IOException - if loading failed
    • loadProperties

      public static Properties loadProperties(String resourceName, ClassLoader classLoader) throws IOException
      Load all properties from the specified class path resource (in ISO-8859-1 encoding), using the given class loader.

      Merges properties if more than one resource of the same name found in the class path.

      Parameters:
      resourceName - the name of the class path resource
      classLoader - the class loader
      Returns:
      the Properties instance
      Throws:
      IOException - if loading failed
    • loadIntoProperties

      public static void loadIntoProperties(Properties props, String resourceName) throws IOException
      Load into the given properties from the specified class path resource (in ISO-8859-1 encoding).

      Merges properties if more than one resource of the same name found in the class path.

      Parameters:
      props - the Properties instance to load into
      resourceName - the name of the class path resource
      Throws:
      IOException - if loading failed
    • loadIntoProperties

      public static void loadIntoProperties(Properties props, String resourceName, ClassLoader classLoader) throws IOException
      Load into given properties from the specified class path resource (in ISO-8859-1 encoding).

      Merges properties if more than one resource of the same name found in the class path.

      Parameters:
      props - the Properties instance to load into
      resourceName - the name of the class path resource
      classLoader - the class loader
      Throws:
      IOException - if loading failed