org.oclc.da.gdfr.registryprototype.properties
Class PropertiesManager

java.lang.Object
  extended by org.oclc.da.gdfr.registryprototype.properties.PropertiesManager

public class PropertiesManager
extends java.lang.Object

PropertiesManager This is a utility class to encapsulate reading all of the OCLC Digital Archives Property Files. This class will use a static initializer to load all of the properties into memory and then let the user call into the class to get the property value. The user must still know the name of the property they need to get.

Author:
JCG
See Also:
Properties

Field Summary
static java.lang.String TEST_PROPS
          This is server-tests properties file.
 
Method Summary
 java.lang.String[] getArrayProperty(java.lang.String propName)
          This method gets the requested property from the properties object in the form of an array of strings.
static java.lang.String[] getArrayProperty(java.lang.String propsFile, java.lang.String propName)
          This method gets the requested property from the properties object.
 java.lang.Boolean getBooleanProperty(java.lang.String propName)
          This method gets the requested property from the properties object in the form of boolean.
static java.lang.Boolean getBooleanProperty(java.lang.String propsFile, java.lang.String propName)
          This method gets the requested property from the properties object.
static PropertiesManager getManager(java.lang.String propsFile)
          Obtain an instance of the PropertiesManager for the file specified.
 java.lang.Long getNumericProperty(java.lang.String propName)
          This method gets the requested property from the properties object in the form of integer.
static java.lang.Long getNumericProperty(java.lang.String propsFile, java.lang.String propName)
          This method gets the requested property from the properties object.
 java.lang.String getProperty(java.lang.String propName)
          This method gets the requested property from the properties object.
static java.lang.String getProperty(java.lang.String propsFile, java.lang.String propName)
          This method gets the requested property from the properties object.
static java.util.Properties loadProps(java.lang.String propsFile)
          Load the properties file specified into properties.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TEST_PROPS

public static final java.lang.String TEST_PROPS
This is server-tests properties file.

See Also:
Constant Field Values
Method Detail

getArrayProperty

public static java.lang.String[] getArrayProperty(java.lang.String propsFile,
                                                  java.lang.String propName)
This method gets the requested property from the properties object.

Parameters:
propsFile - The name of the property file to load from.
propName - The name of the property needed as entered in the property file.
Returns:
The value of the property requested.

getBooleanProperty

public static java.lang.Boolean getBooleanProperty(java.lang.String propsFile,
                                                   java.lang.String propName)
This method gets the requested property from the properties object.

Parameters:
propsFile - The name of the property file to load from.
propName - The name of the property needed as entered in the property file.
Returns:
The value of the property requested.

getManager

public static PropertiesManager getManager(java.lang.String propsFile)
Obtain an instance of the PropertiesManager for the file specified.

Parameters:
propsFile - The name of the properties file to obtain properties for. This file should be in the classpath under a config directory. Use one of the constants defined, e.g. ANNOTATOR_PROPS, when possible.
Returns:
The manager for the properties file specified.

getNumericProperty

public static java.lang.Long getNumericProperty(java.lang.String propsFile,
                                                java.lang.String propName)
This method gets the requested property from the properties object.

Parameters:
propsFile - The name of the property file to load from.
propName - The name of the property needed as entered in the property file.
Returns:
The value of the property requested.

getProperty

public static java.lang.String getProperty(java.lang.String propsFile,
                                           java.lang.String propName)
This method gets the requested property from the properties object.

Parameters:
propsFile - The name of the property file to load from.
propName - The name of the property needed as entered in the property file.
Returns:
The value of the property requested.

loadProps

public static java.util.Properties loadProps(java.lang.String propsFile)
Load the properties file specified into properties. The properties file must exist in the classpath under a config directory.

Parameters:
propsFile - The name of the properties file to load. (e.g. test.properties)

getArrayProperty

public java.lang.String[] getArrayProperty(java.lang.String propName)
This method gets the requested property from the properties object in the form of an array of strings.

Parameters:
propName - The name of the property needed as entered in the property file.
Returns:
The value of the property requested.

getBooleanProperty

public java.lang.Boolean getBooleanProperty(java.lang.String propName)
This method gets the requested property from the properties object in the form of boolean. Use booleanValue to get a boolean value.

Parameters:
propName - The name of the property needed as entered in the property file.
Returns:
The value of the property requested as a Boolean.

getNumericProperty

public java.lang.Long getNumericProperty(java.lang.String propName)
This method gets the requested property from the properties object in the form of integer. Use intValue to get an integer value.

Parameters:
propName - The name of the property needed as entered in the property file.
Returns:
The value of the property requested as a long integer.

getProperty

public java.lang.String getProperty(java.lang.String propName)
This method gets the requested property from the properties object.

Parameters:
propName - The name of the property needed as entered in the property file.
Returns:
The value of the property requested.


Copyright © 2008 OCLC Online Computer Library Center, Inc.. All Rights Reserved.