Package com.aspectran.utils
Class PropertiesLoaderUtils
java.lang.Object
com.aspectran.utils.PropertiesLoaderUtils
Convenient utility methods for loading of java.util.Properties,
performing standard handling of input streams.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
loadIntoProperties
(Properties props, String resourceName) Load into the given properties from the specified class path resource (in ISO-8859-1 encoding).static void
loadIntoProperties
(Properties props, String resourceName, ClassLoader classLoader) Load into given properties from the specified class path resource (in ISO-8859-1 encoding).static Properties
loadProperties
(String resourceName) Load all properties from the specified class path resource (in ISO-8859-1 encoding), using the default class loader.static Properties
loadProperties
(String resourceName, ClassLoader classLoader) Load all properties from the specified class path resource (in ISO-8859-1 encoding), using the given class loader.
-
Constructor Details
-
PropertiesLoaderUtils
public PropertiesLoaderUtils()
-
-
Method Details
-
loadProperties
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 resourceclassLoader
- the class loader- Returns:
- the Properties instance
- Throws:
IOException
- if loading failed
-
loadIntoProperties
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 intoresourceName
- 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 intoresourceName
- the name of the class path resourceclassLoader
- the class loader- Throws:
IOException
- if loading failed
-