com.twainconnect.core
Class PropertyManager

java.lang.Object
  extended by com.twainconnect.core.PropertyManager

public class PropertyManager
extends java.lang.Object

Using a helper class to get to our properties file. The file is bundled in the jar's CLASSPATH. In order to override the values place a new properties file in the path structure in your local CLASSPATH outside of the jar.

Since:
3.0
Version:
5.0.1
Author:
twainconnect.com

Method Summary
static PropertyManager getInstance()
          Singleton interface to get at com/twainconnect/twainconnect.properties
 java.lang.String getSystemProperty(java.lang.String key, java.lang.String defaultValue)
          Wrapper around the System.getProperties().get(key) API call.
 java.lang.String getValue(java.lang.String key)
          Given a key look up the value in the twainconnect.properties file
 java.lang.String getValue(java.lang.String resourceName, java.lang.String key)
          By default the Property Manager uses the "com/twainconnect/twainconnect.properties" file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static PropertyManager getInstance()
Singleton interface to get at com/twainconnect/twainconnect.properties

Returns:
PropertyManager instance

getValue

public java.lang.String getValue(java.lang.String resourceName,
                                 java.lang.String key)
By default the Property Manager uses the "com/twainconnect/twainconnect.properties" file. Send in a differnt properties file name to override this behavior

Parameters:
resourceName - is the name of the properties file
key - of the key-value pair
Returns:
String value in the properties file

getValue

public java.lang.String getValue(java.lang.String key)
Given a key look up the value in the twainconnect.properties file

See Also:
MissingResourceException

getSystemProperty

public java.lang.String getSystemProperty(java.lang.String key,
                                          java.lang.String defaultValue)
Wrapper around the System.getProperties().get(key) API call. Checks for null and empty values. Regardless return a null result under those scenarios

Parameters:
key -
Returns:
Name of property value