com.is.util
Class PropertiesHelper
java.lang.Object
|
+--com.is.util.PropertiesHelper
- public class PropertiesHelper
- extends java.lang.Object
This class consists of convenience methods for using properties files.
It allows for dynamic loading of properties throughout the life
of the web application.
Field Summary |
static org.apache.log4j.Category |
LOG
|
Method Summary |
static java.util.Properties |
getPropertiesForBundle(java.lang.String bundleName)
This static method takes information from a resourceBundle and builds
a properties object from the key-value pairs. |
static java.util.Properties |
loadProperties(java.io.File file)
loadProperties is used to retrieve a Properties object consisting of the
passed-in file. |
static java.util.Properties |
loadProperties(java.lang.String filename)
loadProperties is used to retrieve a Properties object consisting of the
passed-in filename. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LOG
public static final org.apache.log4j.Category LOG
PropertiesHelper
public PropertiesHelper()
loadProperties
public static java.util.Properties loadProperties(java.lang.String filename)
- loadProperties is used to retrieve a Properties object consisting of the
passed-in filename. If there are any errors in loading the Properties
file, null will be returned.
- Parameters:
String
- - The name of the properties file to load- Returns:
- Properties - The Properties object consisting of all the
key/value pairs for the file
loadProperties
public static java.util.Properties loadProperties(java.io.File file)
- loadProperties is used to retrieve a Properties object consisting of the
passed-in file. If there are any errors in loading the Properties file,
null will be returned.
- Parameters:
File
- - The properties file to load- Returns:
- Properties - The Properties object consisting of all the
key/value pairs for the file
getPropertiesForBundle
public static java.util.Properties getPropertiesForBundle(java.lang.String bundleName)
- This static method takes information from a resourceBundle and builds
a properties object from the key-value pairs.
- Parameters:
String
- - the name of the Resource bundle to be read in- Returns:
- Properties - populated with information from the resource bundle
or return null if no bundle is found