org.opengts.util
Class RTConfig

java.lang.Object
  extended by org.opengts.util.RTConfig

public class RTConfig
extends java.lang.Object

Provides static support for hierarchical runtime properties


Nested Class Summary
static interface RTConfig.PropertyGetter
          PropertyGetter interface
static interface RTConfig.PropertySetter
          PropertySetter interface
 
Constructor Summary
RTConfig()
           
 
Method Summary
protected static java.net.URL _getConfigURL()
          Searches for, and returns the URL of the runtime configuration file
static java.lang.String _getString(java.lang.String[] key, java.lang.String dft, boolean dftOK)
          Gets a String value for one of the specified keys
static java.lang.String _getString(java.lang.String key, java.lang.String dft, boolean dftOK)
          Gets the String value for the specified key
static java.lang.String _insertKeyValues(java.lang.Object mainKey, java.lang.String text)
          Replaces ${key} variable references in the specified text with values from the runtime properties.
protected static boolean _isWebApp_1()
           
protected static boolean _isWebApp_2()
           
static void _setServletContextProperties(RTProperties props)
          Sets the Servlet context properties.
protected static void _startupInit(boolean allowChangeSystemProperties)
          Runtime config initialization
static void clearServletContextProperties(java.lang.Object servlet)
          Clears the runtime Servlet context properties This is intended to be called when the Servlet context is destroyed
static java.lang.String findPropertiesForKey(java.lang.String key)
          Returns the name of the RTProperties location for the specified key
static java.lang.String findPropertiesForKey(java.lang.String[] key)
          Returns the name of the RTProperties location for the specified key
static java.math.BigInteger getBigInteger(java.lang.String key)
          Gets a BigInteger property at the specified key
static java.math.BigInteger getBigInteger(java.lang.String[] key, java.math.BigInteger dft)
          Gets a BigInteger property at the specified key
static java.math.BigInteger getBigInteger(java.lang.String[] key, java.math.BigInteger dft, boolean dftOK)
          Gets a BigInteger property at the specified key
static java.math.BigInteger getBigInteger(java.lang.String key, java.math.BigInteger dft)
          Gets a BigInteger property at the specified key
static java.math.BigInteger getBigInteger(java.lang.String key, java.math.BigInteger dft, boolean dftOK)
          Gets a BigInteger property at the specified key
static boolean getBoolean(java.lang.String key)
          Gets a boolean property at the specified key
static boolean getBoolean(java.lang.String[] key, boolean dft)
          Gets a boolean property at the specified key
static boolean getBoolean(java.lang.String[] key, boolean dft, boolean dftOK)
          Gets a boolean property at the specified key
static boolean getBoolean(java.lang.String key, boolean dft)
          Gets a boolean property at the specified key
static boolean getBoolean(java.lang.String key, boolean dft, boolean dftOK)
          Gets a boolean property at the specified key
static java.lang.Class getClass(java.lang.String key)
          Gets a Class property at the specified key
static java.lang.Class getClass(java.lang.String[] key, java.lang.Class dft)
          Gets a Class property from a specified array of keys
static java.lang.Class getClass(java.lang.String[] key, java.lang.Class dft, boolean dftOK)
          Gets a Class property from a specified array of keys
static java.lang.Class getClass(java.lang.String key, java.lang.Class dft)
          Gets a Class property at the specified key
static java.lang.Class getClass(java.lang.String key, java.lang.Class dft, boolean dftOK)
          Gets a Class property from a specified array of keys
static java.net.URL getClassResourceURL(java.lang.Class C)
          Gets the resource location of the specified class
static RTProperties getCommandLineProperties()
          Gets the command line properties RTProperties instance
static RTProperties getConfigFileProperties()
          Gets the RTProperties instance from the config file
static java.lang.String getConfigPropertiesIndexName(int ndx)
          Gets the configuration properties index name assocaited with the specified index
protected static java.net.URL getConfigURL()
          Returns the config file URL
static java.lang.String getContextName()
          Gets the RTKey.CONTEXT_NAME property value.
Typically this returns the name of the parent package directory (ie.
static java.lang.String getContextName(java.lang.String dftName)
          Gets the RTKey.CONTEXT_NAME property value.
Typically this returns the name of the parent package directory (ie.
static java.lang.String getContextPath()
          Gets the RTKey.CONTEXT_PATH property value.
static java.lang.String getContextPath(java.lang.String dftPath)
          Gets the RTKey.CONTEXT_PATH property value.
static double getDouble(java.lang.String key)
          Gets a double property at the specified key
static double getDouble(java.lang.String[] key, double dft)
          Gets a dobule property at the specified key
static double getDouble(java.lang.String[] key, double dft, boolean dftOK)
          Gets a dobule property at the specified key
static double getDouble(java.lang.String key, double dft)
          Gets a double property at the specified key
static double getDouble(java.lang.String key, double dft, boolean dftOK)
          Gets a double property at the specified key
static double[] getDoubleArray(java.lang.String key)
          Gets a double array property at the specified key
static double[] getDoubleArray(java.lang.String[] key, double[] dft)
          Gets a double array property from a specified array of keys
static double[] getDoubleArray(java.lang.String[] key, double[] dft, boolean dftOK)
          Gets a double array property from a specified array of keys
static double[] getDoubleArray(java.lang.String key, double[] dft)
          Gets a double array property from a specified array of keys
static double[] getDoubleArray(java.lang.String key, double[] dft, boolean dftOK)
          Gets a double array property from a specified array of keys
static boolean getEnvironmentVariablesEnabled()
          Gets if system environment variables should be loaded
static java.io.File getFile(java.lang.String key)
          Gets a File property at the specified key
static java.io.File getFile(java.lang.String[] key, java.io.File dft)
          Gets a File property from a specified array of keys
static java.io.File getFile(java.lang.String[] key, java.io.File dft, boolean dftOK)
          Gets a File property from a specified array of keys
static java.io.File getFile(java.lang.String key, java.io.File dft)
          Gets a File property at the specified key
static java.io.File getFile(java.lang.String key, java.io.File dft, boolean dftOK)
          Gets a File property from a specified array of keys
static float getFloat(java.lang.String key)
          Gets a float property at the specified key
static float getFloat(java.lang.String[] key, float dft)
          Gets a float property at the specified key
static float getFloat(java.lang.String[] key, float dft, boolean dftOK)
          Gets a float property at the specified key
static float getFloat(java.lang.String key, float dft)
          Gets a float property at the specified key
static float getFloat(java.lang.String key, float dft, boolean dftOK)
          Gets a float property at the specified key
static java.lang.String getHostName()
          Lookup and return the local host name
static int getInt(java.lang.String key)
          Gets a int property at the specified key
static int getInt(java.lang.String[] key, int dft)
          Gets a int property at the specified key
static int getInt(java.lang.String[] key, int dft, boolean dftOK)
          Gets a int property at the specified key
static int getInt(java.lang.String key, int dft)
          Gets a int property at the specified key
static int getInt(java.lang.String key, int dft, boolean dftOK)
          Gets a int property at the specified key
static int[] getIntArray(java.lang.String key)
          Gets a int array property at the specified key
static int[] getIntArray(java.lang.String[] key, int[] dft)
          Gets a int array property from a specified array of keys
static int[] getIntArray(java.lang.String[] key, int[] dft, boolean dftOK)
          Gets a int array property from a specified array of keys
static int[] getIntArray(java.lang.String key, int[] dft)
          Gets a int array property from a specified array of keys
static int[] getIntArray(java.lang.String key, int[] dft, boolean dftOK)
          Gets a int array property from a specified array of keys
static java.io.File getLoadedConfigDir()
          Returns the File instance of the loaded config file directory, or null if the runtime config was not loaded from a file.
static java.io.File getLoadedConfigFile()
          Returns the File instance of the loaded config file, or null if the runtime config was not loaded from a file.
static java.net.URL getLoadedConfigURL()
          Returns the URL of the loaded config file
static long getLong(java.lang.String key)
          Gets a long property at the specified key
static long getLong(java.lang.String[] key, long dft)
          Gets a long property at the specified key
static long getLong(java.lang.String[] key, long dft, boolean dftOK)
          Gets a long property at the specified key
static long getLong(java.lang.String key, long dft)
          Gets a long property at the specified key
static long getLong(java.lang.String key, long dft, boolean dftOK)
          Gets a long property at the specified key
static long[] getLongArray(java.lang.String key)
          Gets a long array property at the specified key
static long[] getLongArray(java.lang.String[] key, long[] dft)
          Gets a long array property from a specified array of keys
static long[] getLongArray(java.lang.String[] key, long[] dft, boolean dftOK)
          Gets a long array property from a specified array of keys
static long[] getLongArray(java.lang.String key, long[] dft)
          Gets a long array property from a specified array of keys
static long[] getLongArray(java.lang.String key, long[] dft, boolean dftOK)
          Gets a long array property from a specified array of keys
static java.lang.Class<?> getMainClass()
          Gets the main entry point class
static RTProperties getProperties(java.lang.String startsWith, boolean inclDft)
          Returns a new RTProeprties instance populated with all keys starting with the specified value
static RTProperties getPropertiesForKey(java.lang.String[] key, boolean dftOk)
          Returns the RTProperties instance in which the key is defined
static RTProperties getPropertiesForKey(java.lang.String key, boolean dftOk)
          Returns the RTProperties for the specified key
static java.lang.Object getProperty(java.lang.String key)
          Gets the property value of a key
static java.lang.Object getProperty(java.lang.String[] key)
          Gets the property value of a key
static java.lang.Object getProperty(java.lang.String[] key, java.lang.Object dft)
          Gets the property value of a key
static java.lang.Object getProperty(java.lang.String[] key, java.lang.Object dft, boolean dftOk)
          Gets the property value of a key
static java.lang.Object getProperty(java.lang.String key, java.lang.Object dft)
          Gets the property value of a key
static java.lang.Object getProperty(java.lang.String key, java.lang.Object dft, boolean dftOk)
          Gets the property value of a key
static RTConfig.PropertyGetter getPropertyGetter()
          Returns a PropertyGetter for RTConfig
static java.util.Set<java.lang.String> getPropertyKeys(java.lang.String startsWith)
          Returns a set of property keys which start with the specified String
static java.util.Set<java.lang.String> getPropertyKeys(java.lang.String startsWith, boolean inclDft)
          Returns a set of property keys which start with the specified String.
static RTConfig.PropertySetter getPropertySetter()
          Returns a PropertySetter for RTConfig
static RTProperties getRuntimeConstantProperties()
          Gets the runtime constant properties RTProperties instance
static java.lang.Class<?> getServletClass()
          Gets the servelet class if this application is running as a servelet
static java.lang.String getServletClassName()
          Returns the Servlet class name
static java.io.File getServletContextPath()
          Returns the Servlet context path.
static RTProperties getServletContextProperties()
          Gets the serverlet context properties RTProperties instance
static java.lang.String getString(java.lang.String key)
          Gets a String value for one of the specified keys
static java.lang.String getString(java.lang.String[] key)
          Gets a String value for one of the specified keys
static java.lang.String getString(java.lang.String[] key, java.lang.String dft)
          Gets a String value for one of the specified keys
static java.lang.String getString(java.lang.String[] key, java.lang.String dft, boolean dftOK)
          Gets a String value for one of the specified keys
static java.lang.String getString(java.lang.String key, java.lang.String dft)
          Gets the String value for the specified key
static java.lang.String getString(java.lang.String key, java.lang.String dft, boolean dftOK)
          Gets the String value for the specified key
static java.lang.String[] getStringArray(java.lang.String key)
          Gets a string array property at the specified key
static java.lang.String[] getStringArray(java.lang.String[] key, java.lang.String[] dft)
          Gets a string array property from a specified array of keys
static java.lang.String[] getStringArray(java.lang.String[] key, java.lang.String[] dft, boolean dftOK)
          Gets a string array property from a specified array of keys
static java.lang.String[] getStringArray(java.lang.String key, java.lang.String[] dft)
          Gets a string array property from a specified array of keys
static java.lang.String[] getStringArray(java.lang.String key, java.lang.String[] dft, boolean dftOK)
          Gets a string array property from a specified array of keys
static RTProperties getSystemProperties()
          Gets the RTProperties instance representing the system properties.
static RTProperties getTemporaryProperties(java.lang.String key)
          Returns the temporary RTProperties instance that contains the specified key
static int getTemporaryPropertiesStackSize()
          Gets the temporary RTProperties stack size (for current thread)
static RTProperties getThreadProperties()
          Gets the thread local RTProperties instance
static boolean hasContextName()
          Returns true if the RTKey.CONTEXT_NAME property is defined and non-blank
static boolean hasContextPath()
          Returns true if the RTKey.CONTEXT_PATH property is defined and non-blank
static boolean hasProperty(java.lang.String key)
          Returns true if there is a value associated with the specified key.
static boolean hasProperty(java.lang.String[] key)
          Returns true if any of the keys in the specified string array have a value associated with them.
static boolean hasProperty(java.lang.String[] key, boolean dftOk)
          Returns true if any of the keys in the specified string array have a value associated with them.
static boolean hasProperty(java.lang.String key, boolean dftOk)
          Returns true if there is a value associated with the specified key.
static java.lang.String insertKeyValues(java.lang.String text)
          Replaces ${key} variable references in the specified text with values from the runtime properties.
static java.lang.String insertKeyValues(java.lang.String text, java.util.Map<java.lang.String,java.lang.String> customMap)
          Replaces ${key} variable references in the specified text with values from the runtime properties.
static java.lang.String insertKeyValues(java.lang.String text, java.lang.String startDelim, java.lang.String endDelim, java.lang.String dftDelim)
          Replaces key variable references in the specified text with values from the runtime properties.
static java.lang.String insertKeyValues(java.lang.String text, java.lang.String startDelim, java.lang.String endDelim, java.lang.String dftDelim, java.util.Map<java.lang.String,java.lang.String> customMap)
          Replaces key variable references in the specified text with values from the runtime properties.
static boolean isAdminMode()
          Returns true if running in administrative mode
static boolean isCommandLine()
          Returns true if the command-line properties have been defined
static boolean isDebugMode()
          Returns true if debug mode is enabled
static boolean isInitialized()
          Returns true if the Runtime config has been initialized
static boolean isInitializing()
          Returns true if the Runtime config is in the process of being initialized
static boolean isTestMode()
          Returns true if test mode is enabled
static boolean isTrueServlet()
          Returns true if the current context is likely a servlet
static boolean isWebApp()
          Returns true if this instance is running as a webapp
static void main(java.lang.String[] argv)
          Command-line entry point (testing/debugging purposes)
static void popAllTemporaryProperties()
          Clears the temporary RTProperties stack for the current thread
static void popTemporaryProperties(RTProperties props)
          Pops the last temporary RTProperties instance for the current thread
static void printAllProperties(boolean merge)
           
static void printTemporaryProperties(java.lang.String msg)
          Prints the temporary RTProperties instances to stdout
static void pushTemporaryProperties(RTProperties props)
          Pushes the RTProperties instance onto a temporary stack for the current thread
static void reload()
          Reloads all runtime config properties
static void setAdminMode(boolean admin)
          Sets the administrative mode
static void setBigInteger(java.lang.String key, java.math.BigInteger value)
          Sets the property value for the specified key
static void setBoolean(java.lang.String key, boolean value)
          Sets the boolean property value for the specified key
static void setClass(java.lang.String key, java.lang.Class value)
          Sets the Class property value for the specified key
static void setCommandLineArgs(RTProperties cmdLineProps)
          Sets the command line properties and initializes RTConfig if it hasn't been.
static void setCommandLineArgs(RTProperties cmdLineProps, boolean testMode)
          Sets the command line properties and initializes RTConfig if it hasn't been.
static int setCommandLineArgs(java.lang.String[] argv)
          Sets the command line properties and initializes RTConfig if it hasn't been.
static int setCommandLineArgs(java.lang.String[] argv, boolean testMode)
          Sets the command line properties and initializes RTConfig if it hasn't been.
static int setCommandLineArgs(java.lang.String[] argv, java.lang.String[] keyAttr)
          Sets the command line properties and initializes RTConfig if it hasn't been.
static void setContextName(java.lang.String name)
          Sets the RTKey.CONTEXT_NAME property Typically this is set to the name of the parent package directory (ie.
static void setContextPath(java.lang.String path)
          Sets the RTKey.CONTEXT_PATH property value.
static void setDebugMode(boolean debug)
          Sets if debug mode is enabled or not
static void setDouble(java.lang.String key, double value)
          Sets the property value for the specified key
static void setDoubleArray(java.lang.String key, double[] val)
          Sets the long array property value for the specified key
static void setEnvironmentVariablesEnabled(boolean enable)
          Sets if system environment variables will be loaded on next initialization/reload
static void setFile(java.lang.String key, java.io.File value)
          Sets the File property value for the specified key
static void setFloat(java.lang.String key, float value)
          Sets the property value for the specified key
static void setInt(java.lang.String key, int value)
          Sets the property value for the specified key
static void setIntArray(java.lang.String key, int[] val)
          Sets the int array property value for the specified key
static void setLong(java.lang.String key, long value)
          Sets the property value for the specified key
static void setLongArray(java.lang.String key, long[] val)
          Sets the long array property value for the specified key
static void setProperties(java.util.Properties props)
          Adds the properties in the specified Properties to the config file properties
static void setProperties(RTProperties rtprops)
          Adds the properties in the specified RTProperties to the config file properties
static void setProperty(java.lang.String key, java.lang.Object value)
          Sets the value for the specified key
static void setQuiet(boolean q)
          Set Quiet
static void setServletContextProperties(java.util.Map<java.lang.Object,java.lang.Object> props)
          Sets the runtime mode to 'WebApp' and initializes the Servlet context properties.
static void setString(java.lang.String key, java.lang.String value)
          Sets the property value for the specified key
static void setStringArray(java.lang.String key, java.lang.String[] val)
          Sets the string array property value for the specified key
static void setTestMode(boolean test)
          Sets if test mode is enabled
static void setVerbose(boolean v)
          Set Verbose
static void setWebApp(boolean webapp)
          Sets if this instance is running as a webapp
static java.lang.String[] validateCommandLineArgs(java.lang.Object argv)
          Validates the command line arguments in RTConfig against a single string or array of strings listing valid arguments
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RTConfig

public RTConfig()
Method Detail

getPropertySetter

public static RTConfig.PropertySetter getPropertySetter()
Returns a PropertySetter for RTConfig

Returns:
An RTConfig PropertySetter

getPropertyGetter

public static RTConfig.PropertyGetter getPropertyGetter()
Returns a PropertyGetter for RTConfig

Returns:
An RTConfig PropertyGetter

setEnvironmentVariablesEnabled

public static void setEnvironmentVariablesEnabled(boolean enable)
Sets if system environment variables will be loaded on next initialization/reload

Parameters:
enable - True if environment variables should be loaded

getEnvironmentVariablesEnabled

public static boolean getEnvironmentVariablesEnabled()
Gets if system environment variables should be loaded

Returns:
True if environment variables should be loaded

setVerbose

public static void setVerbose(boolean v)
Set Verbose


setQuiet

public static void setQuiet(boolean q)
Set Quiet


getHostName

public static java.lang.String getHostName()
Lookup and return the local host name

Returns:
The local host name

getConfigPropertiesIndexName

public static java.lang.String getConfigPropertiesIndexName(int ndx)
Gets the configuration properties index name assocaited with the specified index

Parameters:
ndx - The configuration properties index name
Returns:
The configuration properties index name

printTemporaryProperties

public static void printTemporaryProperties(java.lang.String msg)
Prints the temporary RTProperties instances to stdout

Parameters:
msg - Displayed message header

getTemporaryProperties

public static RTProperties getTemporaryProperties(java.lang.String key)
Returns the temporary RTProperties instance that contains the specified key

Returns:
The temporary RTProperties instance that contains the specified key

pushTemporaryProperties

public static void pushTemporaryProperties(RTProperties props)
Pushes the RTProperties instance onto a temporary stack for the current thread

Parameters:
props - The RTProperties instance

popTemporaryProperties

public static void popTemporaryProperties(RTProperties props)
Pops the last temporary RTProperties instance for the current thread

Parameters:
props - The RTProperties instance that is the expected entry on the top of the stack

popAllTemporaryProperties

public static void popAllTemporaryProperties()
Clears the temporary RTProperties stack for the current thread


getTemporaryPropertiesStackSize

public static int getTemporaryPropertiesStackSize()
Gets the temporary RTProperties stack size (for current thread)

Returns:
The temporary RTProperties stack size

getThreadProperties

public static RTProperties getThreadProperties()
Gets the thread local RTProperties instance

Returns:
The thread local RTProperties

getRuntimeConstantProperties

public static RTProperties getRuntimeConstantProperties()
Gets the runtime constant properties RTProperties instance

Returns:
The runtime constant properties

getServletContextProperties

public static RTProperties getServletContextProperties()
Gets the serverlet context properties RTProperties instance

Returns:
The serverlet context properties instance

getCommandLineProperties

public static RTProperties getCommandLineProperties()
Gets the command line properties RTProperties instance

Returns:
The command line properties

getConfigFileProperties

public static RTProperties getConfigFileProperties()
Gets the RTProperties instance from the config file

Returns:
The properties obtained from the config file

getSystemProperties

public static RTProperties getSystemProperties()
Gets the RTProperties instance representing the system properties. Values obtained from System.getProperties()

Returns:
The RTProperties instance representing the system properties.
See Also:
System.getProperties()

isCommandLine

public static boolean isCommandLine()
Returns true if the command-line properties have been defined

Returns:
True if the command-line properties have been defined

isTrueServlet

public static boolean isTrueServlet()
Returns true if the current context is likely a servlet

Returns:
True if the current context is likely a servlet

getPropertiesForKey

public static RTProperties getPropertiesForKey(java.lang.String key,
                                               boolean dftOk)
Returns the RTProperties for the specified key

Parameters:
key - The key
dftOk - True to check defaults, if not found elsewhere
Returns:
The RTProperties

getPropertiesForKey

public static RTProperties getPropertiesForKey(java.lang.String[] key,
                                               boolean dftOk)
Returns the RTProperties instance in which the key is defined

Parameters:
key - The key array
dftOk - True to check defaults, if not found elsewhere
Returns:
The RTProperties

findPropertiesForKey

public static java.lang.String findPropertiesForKey(java.lang.String key)
Returns the name of the RTProperties location for the specified key

Parameters:
key - The key
Returns:
The name of the RTProperties location

findPropertiesForKey

public static java.lang.String findPropertiesForKey(java.lang.String[] key)
Returns the name of the RTProperties location for the specified key

Parameters:
key - The key
Returns:
The name of the RTProperties location

setCommandLineArgs

public static int setCommandLineArgs(java.lang.String[] argv)
Sets the command line properties and initializes RTConfig if it hasn't been. Initialization is held off untill this method is called so 'configFile' can be overridden on the command line.

Parameters:
argv - The command line arguments

setCommandLineArgs

public static int setCommandLineArgs(java.lang.String[] argv,
                                     java.lang.String[] keyAttr)
Sets the command line properties and initializes RTConfig if it hasn't been. Initialization is held off untill this method is called so 'configFile' can be overridden on the command line.

Parameters:
argv - The command line arguments
keyAttr - A list of expected keys and attributes. See RTProperties.validateKeyAttributes(java.lang.String[], boolean)
Throws:
java.lang.RuntimeException - If invalid arguments are specified

setCommandLineArgs

public static void setCommandLineArgs(RTProperties cmdLineProps)
Sets the command line properties and initializes RTConfig if it hasn't been. Initialization is held off untill this method is called so 'configFile' can be overridden on the command line.

Parameters:
cmdLineProps - The command line properties

setCommandLineArgs

public static int setCommandLineArgs(java.lang.String[] argv,
                                     boolean testMode)
Sets the command line properties and initializes RTConfig if it hasn't been. Initialization is held off untill this method is called so 'configFile' can be overridden on the command line.

Parameters:
argv - The command line arguments
testMode - does nothing, ignored? [CHECK] [ASK]
Returns:
The next command-line argument, or '-1' if there are no additional command-line arguments. See RTProperties.getNextCommandLineArgumentIndex()

setCommandLineArgs

public static void setCommandLineArgs(RTProperties cmdLineProps,
                                      boolean testMode)
Sets the command line properties and initializes RTConfig if it hasn't been. Initialization is held off untill this method is called so 'configFile' can be overridden on the command line.

Parameters:
cmdLineProps - The command line properties
testMode - does nothing, ignored? [CHECK] [ASK]

validateCommandLineArgs

public static java.lang.String[] validateCommandLineArgs(java.lang.Object argv)
Validates the command line arguments in RTConfig against a single string or array of strings listing valid arguments

Parameters:
argv - A single or array of valid arguments
Returns:
Array of keys of the invalid/unrecognised arguments

_setServletContextProperties

public static void _setServletContextProperties(RTProperties props)
Sets the Servlet context properties.

Parameters:
props - A map containing the Servlet context properties

setServletContextProperties

public static void setServletContextProperties(java.util.Map<java.lang.Object,java.lang.Object> props)
Sets the runtime mode to 'WebApp' and initializes the Servlet context properties.

Parameters:
props - A map containing the Servlet context properties

clearServletContextProperties

public static void clearServletContextProperties(java.lang.Object servlet)
Clears the runtime Servlet context properties This is intended to be called when the Servlet context is destroyed

Parameters:
servlet - The servlet instance (not currently used)

isInitializing

public static boolean isInitializing()
Returns true if the Runtime config is in the process of being initialized

Returns:
True if in the process of initializing

isInitialized

public static boolean isInitialized()
Returns true if the Runtime config has been initialized

Returns:
True if initialized

getLoadedConfigURL

public static java.net.URL getLoadedConfigURL()
Returns the URL of the loaded config file

Returns:
The URL of the loaded config file

getLoadedConfigFile

public static java.io.File getLoadedConfigFile()
Returns the File instance of the loaded config file, or null if the runtime config was not loaded from a file.

Returns:
The File instance of the loaded config file.

getLoadedConfigDir

public static java.io.File getLoadedConfigDir()
Returns the File instance of the loaded config file directory, or null if the runtime config was not loaded from a file.

Returns:
The File instance of the loaded config file directory.

getConfigURL

protected static java.net.URL getConfigURL()
Returns the config file URL

Returns:
The config file URL

_getConfigURL

protected static java.net.URL _getConfigURL()
                                     throws java.net.MalformedURLException
Searches for, and returns the URL of the runtime configuration file

Returns:
The URL of the runtime configuration file
Throws:
java.net.MalformedURLException

reload

public static void reload()
Reloads all runtime config properties


_startupInit

protected static void _startupInit(boolean allowChangeSystemProperties)
Runtime config initialization

Parameters:
allowChangeSystemProperties - True to allow System properties update, false for read-only

getClassResourceURL

public static java.net.URL getClassResourceURL(java.lang.Class C)
Gets the resource location of the specified class

Parameters:
C - The class
Returns:
The resource URL

printAllProperties

public static void printAllProperties(boolean merge)

insertKeyValues

public static java.lang.String insertKeyValues(java.lang.String text)
Replaces ${key} variable references in the specified text with values from the runtime properties. Default key delimiters will be used.

Parameters:
text - The target String
Returns:
The string containing the replaced key variables
See Also:
StringTools.insertKeyValues(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String[][])

insertKeyValues

public static java.lang.String insertKeyValues(java.lang.String text,
                                               java.util.Map<java.lang.String,java.lang.String> customMap)
Replaces ${key} variable references in the specified text with values from the runtime properties. Default key delimiters will be used

Parameters:
text - The target String
customMap - A custom map to try to get the key value from before checking RTConfig
Returns:
The string containing the replaced key variables
See Also:
StringTools.insertKeyValues(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String[][])

insertKeyValues

public static java.lang.String insertKeyValues(java.lang.String text,
                                               java.lang.String startDelim,
                                               java.lang.String endDelim,
                                               java.lang.String dftDelim)
Replaces key variable references in the specified text with values from the runtime properties. Specified key delimiters will be used

Parameters:
text - The target String
startDelim - The pattern used to determine the start of a key variable
endDelim - The pattern used to determine the end of a key variable
dftDelim - The pattern used to delimit a default value for the key
Returns:
The string containing the replaced key variables
See Also:
StringTools.insertKeyValues(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String[][])

insertKeyValues

public static java.lang.String insertKeyValues(java.lang.String text,
                                               java.lang.String startDelim,
                                               java.lang.String endDelim,
                                               java.lang.String dftDelim,
                                               java.util.Map<java.lang.String,java.lang.String> customMap)
Replaces key variable references in the specified text with values from the runtime properties. Specified key delimiters will be used

Parameters:
text - The target String
startDelim - The pattern used to determine the start of a key variable
endDelim - The pattern used to determine the end of a key variable
dftDelim - The pattern used to delimit a default value for the key
customMap - A custom map to try to get the key value from before checking RTConfig
Returns:
The string containing the replaced key variables
See Also:
StringTools.insertKeyValues(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String[][])

_insertKeyValues

public static java.lang.String _insertKeyValues(java.lang.Object mainKey,
                                                java.lang.String text)
Replaces ${key} variable references in the specified text with values from the runtime properties. Default key delimiters will be used.

Parameters:
mainKey - The main key
text - The target String
Returns:
The string containing the replaced key variables
See Also:
StringTools.insertKeyValues(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String[][])

getPropertyKeys

public static java.util.Set<java.lang.String> getPropertyKeys(java.lang.String startsWith)
Returns a set of property keys which start with the specified String

Parameters:
startsWith - Searth string
Returns:
A set of property keys which start with the specified String

getPropertyKeys

public static java.util.Set<java.lang.String> getPropertyKeys(java.lang.String startsWith,
                                                              boolean inclDft)
Returns a set of property keys which start with the specified String. (may return an empty list, but does not return null)

Parameters:
startsWith - Searth string
inclDft - True to include default keys
Returns:
A set of property keys which start with the specified String

getProperties

public static RTProperties getProperties(java.lang.String startsWith,
                                         boolean inclDft)
Returns a new RTProeprties instance populated with all keys starting with the specified value

Parameters:
startsWith - Searth string
inclDft - True to include default keys
Returns:
The new RTProperties instance (never null)

hasProperty

public static boolean hasProperty(java.lang.String key)
Returns true if there is a value associated with the specified key. Default values are also included.

Parameters:
key - The key
Returns:
if there is a value associated with the specified key

hasProperty

public static boolean hasProperty(java.lang.String key,
                                  boolean dftOk)
Returns true if there is a value associated with the specified key.

Parameters:
key - The key
dftOk - True if default values count
Returns:
if there is a value associated with the specified key

hasProperty

public static boolean hasProperty(java.lang.String[] key)
Returns true if any of the keys in the specified string array have a value associated with them. Default values are also included.

Parameters:
key - The key
Returns:
if there is a value associated with any of the specified keys

hasProperty

public static boolean hasProperty(java.lang.String[] key,
                                  boolean dftOk)
Returns true if any of the keys in the specified string array have a value associated with them.

Parameters:
key - The key
dftOk - True if default values count
Returns:
if there is a value associated with any of the specified keys

getProperty

public static java.lang.Object getProperty(java.lang.String key)
Gets the property value of a key

Parameters:
key - The key to get the property value of
Returns:
The property value of the key
See Also:
RTProperties.getProperty(java.lang.Object, java.lang.Object)

getProperty

public static java.lang.Object getProperty(java.lang.String[] key)
Gets the property value of a key

Parameters:
key - The key list to get the property value of
Returns:
The property value of the key
See Also:
RTProperties.getProperty(java.lang.Object, java.lang.Object)

getProperty

public static java.lang.Object getProperty(java.lang.String key,
                                           java.lang.Object dft)
Gets the property value of a key

Parameters:
key - The key to get the property value of
dft - The default value to return if none found
Returns:
The property value of the key
See Also:
RTProperties.getProperty(java.lang.Object, java.lang.Object)

getProperty

public static java.lang.Object getProperty(java.lang.String[] key,
                                           java.lang.Object dft)
Gets the property value of a key

Parameters:
key - The key list to get the property value of
dft - The default value to return if none found
Returns:
The property value of the key
See Also:
RTProperties.getProperty(java.lang.Object, java.lang.Object)

getProperty

public static java.lang.Object getProperty(java.lang.String key,
                                           java.lang.Object dft,
                                           boolean dftOk)
Gets the property value of a key

Parameters:
key - The key to get the property value of
dft - The default value to return if none found
dftOk - True to check defaults, if not found elsewhere
Returns:
The property value of the key
See Also:
RTProperties.getProperty(java.lang.Object, java.lang.Object)

getProperty

public static java.lang.Object getProperty(java.lang.String[] key,
                                           java.lang.Object dft,
                                           boolean dftOk)
Gets the property value of a key

Parameters:
key - The key list to get the property value of
dft - The default value to return if none found
dftOk - True to check defaults, if not found elsewhere
Returns:
The property value of the key
See Also:
RTProperties.getProperty(java.lang.Object, java.lang.Object)

setProperty

public static void setProperty(java.lang.String key,
                               java.lang.Object value)
Sets the value for the specified key

Parameters:
key - The property key
value - The value to associate with the specified key

setProperties

public static void setProperties(java.util.Properties props)
Adds the properties in the specified Properties to the config file properties

Parameters:
props - The Properties instance from which properties will be loaded

setProperties

public static void setProperties(RTProperties rtprops)
Adds the properties in the specified RTProperties to the config file properties

Parameters:
rtprops - The RTProperties instance from which properties will be loaded

_getString

public static java.lang.String _getString(java.lang.String key,
                                          java.lang.String dft,
                                          boolean dftOK)
Gets the String value for the specified key

Parameters:
key - The property key
dft - The default value return if the key is not found
dftOK - True to check defaults, if not found elsewhere
Returns:
The String value, or 'dft' if the key is not found

_getString

public static java.lang.String _getString(java.lang.String[] key,
                                          java.lang.String dft,
                                          boolean dftOK)
Gets a String value for one of the specified keys

Parameters:
key - The property keys
dft - The default value return if the key is not found
dftOK - True to check defaults, if not found elsewhere
Returns:
The String value, or 'dft' if the key is not found

getString

public static java.lang.String getString(java.lang.String key)
Gets a String value for one of the specified keys

Parameters:
key - The property key
Returns:
The String value, or 'null' if the key is not found

getString

public static java.lang.String getString(java.lang.String[] key)
Gets a String value for one of the specified keys

Parameters:
key - The property keys
Returns:
The String value, or 'null' if the key is not found

getString

public static java.lang.String getString(java.lang.String key,
                                         java.lang.String dft)
Gets the String value for the specified key

Parameters:
key - The property key
dft - The default value return if the key is not found
Returns:
The String value, or 'dft' if the key is not found

getString

public static java.lang.String getString(java.lang.String key,
                                         java.lang.String dft,
                                         boolean dftOK)
Gets the String value for the specified key

Parameters:
key - The property key
dft - The default value return if the key is not found
dftOK - True to check defaults, if not found elsewhere
Returns:
The String value, or 'dft' if the key is not found

getString

public static java.lang.String getString(java.lang.String[] key,
                                         java.lang.String dft)
Gets a String value for one of the specified keys

Parameters:
key - The property keys
dft - The default value return if the key is not found
Returns:
The String value, or 'dft' if the key is not found

getString

public static java.lang.String getString(java.lang.String[] key,
                                         java.lang.String dft,
                                         boolean dftOK)
Gets a String value for one of the specified keys

Parameters:
key - The property keys
dft - The default value return if the key is not found
dftOK - True to check defaults, if not found elsewhere
Returns:
The String value, or 'dft' if the key is not found

setString

public static void setString(java.lang.String key,
                             java.lang.String value)
Sets the property value for the specified key

Parameters:
key - The property key
value - The property value to set.

getStringArray

public static java.lang.String[] getStringArray(java.lang.String key)
Gets a string array property at the specified key

Parameters:
key - The key of the property
Returns:
The string array value of the property
See Also:
StringTools.parseArray(String s, char arrayDelim)

getStringArray

public static java.lang.String[] getStringArray(java.lang.String key,
                                                java.lang.String[] dft)
Gets a string array property from a specified array of keys

Parameters:
key - An array of property keys. The value of the first matching key will be returned.
dft - The default value to return if an entry was not found
Returns:
The string array value of the property
See Also:
StringTools.parseArray(String s, char arrayDelim)

getStringArray

public static java.lang.String[] getStringArray(java.lang.String key,
                                                java.lang.String[] dft,
                                                boolean dftOK)
Gets a string array property from a specified array of keys

Parameters:
key - An array of property keys. The value of the first matching key will be returned.
dft - The default value to return if an entry was not found
dftOK - True to check defaults, if not found elsewhere
Returns:
The string array value of the property
See Also:
StringTools.parseArray(String s, char arrayDelim)

getStringArray

public static java.lang.String[] getStringArray(java.lang.String[] key,
                                                java.lang.String[] dft)
Gets a string array property from a specified array of keys

Parameters:
key - An array of property keys. The value of the first matching key will be returned.
dft - The default value to return if an entry was not found
Returns:
The string array value of the property
See Also:
StringTools.parseArray(String s, char arrayDelim)

getStringArray

public static java.lang.String[] getStringArray(java.lang.String[] key,
                                                java.lang.String[] dft,
                                                boolean dftOK)
Gets a string array property from a specified array of keys

Parameters:
key - An array of property keys. The value of the first matching key will be returned.
dft - The default value to return if an entry was not found
dftOK - True to check defaults, if not found elsewhere
Returns:
The string array value of the property
See Also:
StringTools.parseArray(String s, char arrayDelim)

setStringArray

public static void setStringArray(java.lang.String key,
                                  java.lang.String[] val)
Sets the string array property value for the specified key

Parameters:
key - The property key
val - The property value to set.

getClass

public static java.lang.Class getClass(java.lang.String key)
Gets a Class property at the specified key

Parameters:
key - The key of the property
Returns:
The Class value of the property

getClass

public static java.lang.Class getClass(java.lang.String key,
                                       java.lang.Class dft)
Gets a Class property at the specified key

Parameters:
key - The key of the property
dft - The default value to return if an entry was not found
Returns:
The Class value of the property

getClass

public static java.lang.Class getClass(java.lang.String key,
                                       java.lang.Class dft,
                                       boolean dftOK)
Gets a Class property from a specified array of keys

Parameters:
key - A property key.
dft - The default value to return if an entry was not found
dftOK - True to check defaults, if not found elsewhere
Returns:
The Class value of the property

getClass

public static java.lang.Class getClass(java.lang.String[] key,
                                       java.lang.Class dft)
Gets a Class property from a specified array of keys

Parameters:
key - An array of property keys. The value of the first matching key will be returned.
dft - The default value to return if an entry was not found
Returns:
The Class value of the property

getClass

public static java.lang.Class getClass(java.lang.String[] key,
                                       java.lang.Class dft,
                                       boolean dftOK)
Gets a Class property from a specified array of keys

Parameters:
key - An array of property keys. The value of the first matching key will be returned.
dft - The default value to return if an entry was not found
dftOK - True to check defaults, if not found elsewhere
Returns:
The Class value of the property

setClass

public static void setClass(java.lang.String key,
                            java.lang.Class value)
Sets the Class property value for the specified key

Parameters:
key - The property key
value - The property value to set.

getFile

public static java.io.File getFile(java.lang.String key)
Gets a File property at the specified key

Parameters:
key - The key of the property
Returns:
The File value of the property

getFile

public static java.io.File getFile(java.lang.String key,
                                   java.io.File dft)
Gets a File property at the specified key

Parameters:
key - The key of the property
dft - The default value to return if an entry was not found
Returns:
The File value of the property

getFile

public static java.io.File getFile(java.lang.String key,
                                   java.io.File dft,
                                   boolean dftOK)
Gets a File property from a specified array of keys

Parameters:
key - A property key.
dft - The default value to return if an entry was not found
dftOK - True to check defaults, if not found elsewhere
Returns:
The File value of the property

getFile

public static java.io.File getFile(java.lang.String[] key,
                                   java.io.File dft)
Gets a File property from a specified array of keys

Parameters:
key - An array of property keys. The value of the first matching key will be returned.
dft - The default value to return if an entry was not found
Returns:
The File value of the property

getFile

public static java.io.File getFile(java.lang.String[] key,
                                   java.io.File dft,
                                   boolean dftOK)
Gets a File property from a specified array of keys

Parameters:
key - An array of property keys. The value of the first matching key will be returned.
dft - The default value to return if an entry was not found
dftOK - True to check defaults, if not found elsewhere
Returns:
The File value of the property

setFile

public static void setFile(java.lang.String key,
                           java.io.File value)
Sets the File property value for the specified key

Parameters:
key - The property key
value - The property value to set.

getDouble

public static double getDouble(java.lang.String key)
Gets a double property at the specified key

Parameters:
key - The key of the property
Returns:
The double value of the property

getDouble

public static double getDouble(java.lang.String key,
                               double dft)
Gets a double property at the specified key

Parameters:
key - The key of the property
dft - The default value to return if an entry was not found
Returns:
The double value of the property

getDouble

public static double getDouble(java.lang.String key,
                               double dft,
                               boolean dftOK)
Gets a double property at the specified key

Parameters:
key - The key of the property
dft - The default value to return if an entry was not found
dftOK - True to check defaults, if not found elsewhere
Returns:
The double value of the property

getDouble

public static double getDouble(java.lang.String[] key,
                               double dft)
Gets a dobule property at the specified key

Parameters:
key - An array of property keys. The value of the first matching key will be returned.
dft - The default value to return if an entry was not found
Returns:
The double value of the property

getDouble

public static double getDouble(java.lang.String[] key,
                               double dft,
                               boolean dftOK)
Gets a dobule property at the specified key

Parameters:
key - An array of property keys. The value of the first matching key will be returned.
dft - The default value to return if an entry was not found
dftOK - True to check defaults, if not found elsewhere
Returns:
The double value of the property

setDouble

public static void setDouble(java.lang.String key,
                             double value)
Sets the property value for the specified key

Parameters:
key - The property key
value - The property value to set.

getFloat

public static float getFloat(java.lang.String key)
Gets a float property at the specified key

Parameters:
key - The key of the property
Returns:
The float value of the property

getFloat

public static float getFloat(java.lang.String key,
                             float dft)
Gets a float property at the specified key

Parameters:
key - The key of the property
dft - The default value to return if an entry was not found
Returns:
The float value of the property

getFloat

public static float getFloat(java.lang.String key,
                             float dft,
                             boolean dftOK)
Gets a float property at the specified key

Parameters:
key - The key of the property
dft - The default value to return if an entry was not found
dftOK - True to check defaults, if not found elsewhere
Returns:
The float value of the property

getFloat

public static float getFloat(java.lang.String[] key,
                             float dft)
Gets a float property at the specified key

Parameters:
key - An array of property keys. The value of the first matching key will be returned.
dft - The default value to return if an entry was not found
Returns:
The float value of the property

getFloat

public static float getFloat(java.lang.String[] key,
                             float dft,
                             boolean dftOK)
Gets a float property at the specified key

Parameters:
key - An array of property keys. The value of the first matching key will be returned.
dft - The default value to return if an entry was not found
dftOK - True to check defaults, if not found elsewhere
Returns:
The float value of the property

setFloat

public static void setFloat(java.lang.String key,
                            float value)
Sets the property value for the specified key

Parameters:
key - The property key
value - The property value to set.

getBigInteger

public static java.math.BigInteger getBigInteger(java.lang.String key)
Gets a BigInteger property at the specified key

Parameters:
key - The key of the property
Returns:
The BigInteger value of the property

getBigInteger

public static java.math.BigInteger getBigInteger(java.lang.String key,
                                                 java.math.BigInteger dft)
Gets a BigInteger property at the specified key

Parameters:
key - The key of the property
dft - The default value to return if an entry was not found
Returns:
The BigInteger value of the property

getBigInteger

public static java.math.BigInteger getBigInteger(java.lang.String key,
                                                 java.math.BigInteger dft,
                                                 boolean dftOK)
Gets a BigInteger property at the specified key

Parameters:
key - The key of the property
dft - The default value to return if an entry was not found
dftOK - True to check defaults, if not found elsewhere
Returns:
The BigInteger value of the property

getBigInteger

public static java.math.BigInteger getBigInteger(java.lang.String[] key,
                                                 java.math.BigInteger dft)
Gets a BigInteger property at the specified key

Parameters:
key - An array of property keys. The value of the first matching key will be returned.
dft - The default value to return if an entry was not found
Returns:
The BigInteger value of the property

getBigInteger

public static java.math.BigInteger getBigInteger(java.lang.String[] key,
                                                 java.math.BigInteger dft,
                                                 boolean dftOK)
Gets a BigInteger property at the specified key

Parameters:
key - An array of property keys. The value of the first matching key will be returned.
dft - The default value to return if an entry was not found
dftOK - True to check defaults, if not found elsewhere
Returns:
The BigInteger value of the property

setBigInteger

public static void setBigInteger(java.lang.String key,
                                 java.math.BigInteger value)
Sets the property value for the specified key

Parameters:
key - The property key
value - The property value to set.

getLong

public static long getLong(java.lang.String key)
Gets a long property at the specified key

Parameters:
key - The key of the property
Returns:
The long value of the property

getLong

public static long getLong(java.lang.String key,
                           long dft)
Gets a long property at the specified key

Parameters:
key - The key of the property
dft - The default value to return if an entry was not found
Returns:
The long value of the property

getLong

public static long getLong(java.lang.String key,
                           long dft,
                           boolean dftOK)
Gets a long property at the specified key

Parameters:
key - The key of the property
dft - The default value to return if an entry was not found
dftOK - True to check defaults, if not found elsewhere
Returns:
The long value of the property

getLong

public static long getLong(java.lang.String[] key,
                           long dft)
Gets a long property at the specified key

Parameters:
key - An array of property keys. The value of the first matching key will be returned.
dft - The default value to return if an entry was not found
Returns:
The long value of the property

getLong

public static long getLong(java.lang.String[] key,
                           long dft,
                           boolean dftOK)
Gets a long property at the specified key

Parameters:
key - An array of property keys. The value of the first matching key will be returned.
dft - The default value to return if an entry was not found
dftOK - True to check defaults, if not found elsewhere
Returns:
The long value of the property

setLong

public static void setLong(java.lang.String key,
                           long value)
Sets the property value for the specified key

Parameters:
key - The property key
value - The property value to set.

getInt

public static int getInt(java.lang.String key)
Gets a int property at the specified key

Parameters:
key - The key of the property
Returns:
The int value of the property

getInt

public static int getInt(java.lang.String key,
                         int dft)
Gets a int property at the specified key

Parameters:
key - The key of the property
dft - The default value to return if an entry was not found
Returns:
The int value of the property

getInt

public static int getInt(java.lang.String key,
                         int dft,
                         boolean dftOK)
Gets a int property at the specified key

Parameters:
key - The key of the property
dft - The default value to return if an entry was not found
dftOK - True to check defaults, if not found elsewhere
Returns:
The int value of the property

getInt

public static int getInt(java.lang.String[] key,
                         int dft)
Gets a int property at the specified key

Parameters:
key - An array of property keys. The value of the first matching key will be returned.
dft - The default value to return if an entry was not found
Returns:
The int value of the property

getInt

public static int getInt(java.lang.String[] key,
                         int dft,
                         boolean dftOK)
Gets a int property at the specified key

Parameters:
key - An array of property keys. The value of the first matching key will be returned.
dft - The default value to return if an entry was not found
dftOK - True to check defaults, if not found elsewhere
Returns:
The int value of the property

setInt

public static void setInt(java.lang.String key,
                          int value)
Sets the property value for the specified key

Parameters:
key - The property key
value - The property value to set.

getIntArray

public static int[] getIntArray(java.lang.String key)
Gets a int array property at the specified key

Parameters:
key - The key of the property
Returns:
The int array value of the property
See Also:
StringTools.parseArray(String s, char arrayDelim)

getIntArray

public static int[] getIntArray(java.lang.String key,
                                int[] dft)
Gets a int array property from a specified array of keys

Parameters:
key - An array of property keys. The value of the first matching key will be returned.
dft - The default value to return if an entry was not found
Returns:
The int array value of the property
See Also:
StringTools.parseArray(String s, char arrayDelim)

getIntArray

public static int[] getIntArray(java.lang.String key,
                                int[] dft,
                                boolean dftOK)
Gets a int array property from a specified array of keys

Parameters:
key - An array of property keys. The value of the first matching key will be returned.
dft - The default value to return if an entry was not found
dftOK - True to check defaults, if not found elsewhere
Returns:
The int array value of the property
See Also:
StringTools.parseArray(String s, char arrayDelim)

getIntArray

public static int[] getIntArray(java.lang.String[] key,
                                int[] dft)
Gets a int array property from a specified array of keys

Parameters:
key - An array of property keys. The value of the first matching key will be returned.
dft - The default value to return if an entry was not found
Returns:
The int array value of the property
See Also:
StringTools.parseArray(String s, char arrayDelim)

getIntArray

public static int[] getIntArray(java.lang.String[] key,
                                int[] dft,
                                boolean dftOK)
Gets a int array property from a specified array of keys

Parameters:
key - An array of property keys. The value of the first matching key will be returned.
dft - The default value to return if an entry was not found
dftOK - True to check defaults, if not found elsewhere
Returns:
The int array value of the property

setIntArray

public static void setIntArray(java.lang.String key,
                               int[] val)
Sets the int array property value for the specified key

Parameters:
key - The property key
val - The property value to set.

getLongArray

public static long[] getLongArray(java.lang.String key)
Gets a long array property at the specified key

Parameters:
key - The key of the property
Returns:
The long array value of the property
See Also:
StringTools.parseArray(String s, char arrayDelim)

getLongArray

public static long[] getLongArray(java.lang.String key,
                                  long[] dft)
Gets a long array property from a specified array of keys

Parameters:
key - An array of property keys. The value of the first matching key will be returned.
dft - The default value to return if an entry was not found
Returns:
The long array value of the property
See Also:
StringTools.parseArray(String s, char arrayDelim)

getLongArray

public static long[] getLongArray(java.lang.String key,
                                  long[] dft,
                                  boolean dftOK)
Gets a long array property from a specified array of keys

Parameters:
key - An array of property keys. The value of the first matching key will be returned.
dft - The default value to return if an entry was not found
dftOK - True to check defaults, if not found elsewhere
Returns:
The long array value of the property
See Also:
StringTools.parseArray(String s, char arrayDelim)

getLongArray

public static long[] getLongArray(java.lang.String[] key,
                                  long[] dft)
Gets a long array property from a specified array of keys

Parameters:
key - An array of property keys. The value of the first matching key will be returned.
dft - The default value to return if an entry was not found
Returns:
The long array value of the property
See Also:
StringTools.parseArray(String s, char arrayDelim)

getLongArray

public static long[] getLongArray(java.lang.String[] key,
                                  long[] dft,
                                  boolean dftOK)
Gets a long array property from a specified array of keys

Parameters:
key - An array of property keys. The value of the first matching key will be returned.
dft - The default value to return if an entry was not found
dftOK - True to check defaults, if not found elsewhere
Returns:
The long array value of the property

setLongArray

public static void setLongArray(java.lang.String key,
                                long[] val)
Sets the long array property value for the specified key

Parameters:
key - The property key
val - The property value to set.

getDoubleArray

public static double[] getDoubleArray(java.lang.String key)
Gets a double array property at the specified key

Parameters:
key - The key of the property
Returns:
The double array value of the property
See Also:
StringTools.parseArray(String s, char arrayDelim)

getDoubleArray

public static double[] getDoubleArray(java.lang.String key,
                                      double[] dft)
Gets a double array property from a specified array of keys

Parameters:
key - An array of property keys. The value of the first matching key will be returned.
dft - The default value to return if an entry was not found
Returns:
The double array value of the property
See Also:
StringTools.parseArray(String s, char arrayDelim)

getDoubleArray

public static double[] getDoubleArray(java.lang.String key,
                                      double[] dft,
                                      boolean dftOK)
Gets a double array property from a specified array of keys

Parameters:
key - An array of property keys. The value of the first matching key will be returned.
dft - The default value to return if an entry was not found
dftOK - True to check defaults, if not found elsewhere
Returns:
The double array value of the property
See Also:
StringTools.parseArray(String s, char arrayDelim)

getDoubleArray

public static double[] getDoubleArray(java.lang.String[] key,
                                      double[] dft)
Gets a double array property from a specified array of keys

Parameters:
key - An array of property keys. The value of the first matching key will be returned.
dft - The default value to return if an entry was not found
Returns:
The double array value of the property
See Also:
StringTools.parseArray(String s, char arrayDelim)

getDoubleArray

public static double[] getDoubleArray(java.lang.String[] key,
                                      double[] dft,
                                      boolean dftOK)
Gets a double array property from a specified array of keys

Parameters:
key - An array of property keys. The value of the first matching key will be returned.
dft - The default value to return if an entry was not found
dftOK - True to check defaults, if not found elsewhere
Returns:
The double array value of the property

setDoubleArray

public static void setDoubleArray(java.lang.String key,
                                  double[] val)
Sets the long array property value for the specified key

Parameters:
key - The property key
val - The property value to set.

getBoolean

public static boolean getBoolean(java.lang.String key)
Gets a boolean property at the specified key

Parameters:
key - The key of the property
Returns:
The boolean value of the property

getBoolean

public static boolean getBoolean(java.lang.String key,
                                 boolean dft)
Gets a boolean property at the specified key

Parameters:
key - The key of the property
dft - The default value to return if an entry was not found
Returns:
The boolean value of the property

getBoolean

public static boolean getBoolean(java.lang.String key,
                                 boolean dft,
                                 boolean dftOK)
Gets a boolean property at the specified key

Parameters:
key - The key of the property
dft - The default value to return if an entry was not found
dftOK - True to check defaults, if not found elsewhere
Returns:
The boolean value of the property

getBoolean

public static boolean getBoolean(java.lang.String[] key,
                                 boolean dft)
Gets a boolean property at the specified key

Parameters:
key - An array of property keys. The value of the first matching key will be returned.
dft - The default value to return if an entry was not found
Returns:
The boolean value of the property

getBoolean

public static boolean getBoolean(java.lang.String[] key,
                                 boolean dft,
                                 boolean dftOK)
Gets a boolean property at the specified key

Parameters:
key - An array of property keys. The value of the first matching key will be returned.
dft - The default value to return if an entry was not found
dftOK - True to check defaults, if not found elsewhere
Returns:
The boolean value of the property

setBoolean

public static void setBoolean(java.lang.String key,
                              boolean value)
Sets the boolean property value for the specified key

Parameters:
key - The property key
value - The property value to set.

setAdminMode

public static void setAdminMode(boolean admin)
Sets the administrative mode

Parameters:
admin - True to set administrative mode

isAdminMode

public static boolean isAdminMode()
Returns true if running in administrative mode

Returns:
True if running in administrative mode

setDebugMode

public static void setDebugMode(boolean debug)
Sets if debug mode is enabled or not

Parameters:
debug - True to enable debug mode

isDebugMode

public static boolean isDebugMode()
Returns true if debug mode is enabled

Returns:
True if debug mode is enabled

setTestMode

public static void setTestMode(boolean test)
Sets if test mode is enabled

Parameters:
test - True to enabled test mode

isTestMode

public static boolean isTestMode()
Returns true if test mode is enabled

Returns:
True if test mode is enabled

setContextName

public static void setContextName(java.lang.String name)
Sets the RTKey.CONTEXT_NAME property Typically this is set to the name of the parent package directory (ie. as in "c" in the class "a.b.c.Main"), but this can be set to other values, depending on where it is used.

Parameters:
name - The CONTEXT_NAME value.

getContextName

public static java.lang.String getContextName(java.lang.String dftName)
Gets the RTKey.CONTEXT_NAME property value.
Typically this returns the name of the parent package directory (ie. as in "c" in the class "a.b.c.Main"), but may return other values, depending on where it is used.

Parameters:
dftName - The default path to return if CONTEXT_NAME is undefined/blank
Returns:
The CONTEXT_NAME String, or the default value if undefined/blank.

getContextName

public static java.lang.String getContextName()
Gets the RTKey.CONTEXT_NAME property value.
Typically this returns the name of the parent package directory (ie. as in "c" in the class "a.b.c.Main"), but may return other values, depending on where it is used.

Returns:
The CONTEXT_NAME String, or null if undefined/blank.

hasContextName

public static boolean hasContextName()
Returns true if the RTKey.CONTEXT_NAME property is defined and non-blank

Returns:
True if the RTKey.CONTEXT_NAME property is defined and non-blank

setContextPath

public static void setContextPath(java.lang.String path)
Sets the RTKey.CONTEXT_PATH property value.

Parameters:
path - The CONTEXT_PATH value.

getContextPath

public static java.lang.String getContextPath(java.lang.String dftPath)
Gets the RTKey.CONTEXT_PATH property value.

Parameters:
dftPath - The default path to return if CONTEXT_PATH is undefined/blank
Returns:
The CONTEXT_PATH String, or the default value if undefined/blank.

getContextPath

public static java.lang.String getContextPath()
Gets the RTKey.CONTEXT_PATH property value.

Returns:
The CONTEXT_PATH String, or null if undefined/blank.

hasContextPath

public static boolean hasContextPath()
Returns true if the RTKey.CONTEXT_PATH property is defined and non-blank

Returns:
True if the RTKey.CONTEXT_PATH property is defined and non-blank

getServletContextPath

public static java.io.File getServletContextPath()
Returns the Servlet context path. Returns null if the current context is not a Servlet, or if the context path has not been defined.

Returns:
The servlet context path File instance

setWebApp

public static void setWebApp(boolean webapp)
Sets if this instance is running as a webapp

Parameters:
webapp - True if this instance is running as a webapp

isWebApp

public static boolean isWebApp()
Returns true if this instance is running as a webapp

Returns:
True if this instance is running as a webapp

_isWebApp_1

protected static boolean _isWebApp_1()

_isWebApp_2

protected static boolean _isWebApp_2()

getMainClass

public static java.lang.Class<?> getMainClass()
Gets the main entry point class

Returns:
The main entry point class, or null if the main entry point class could not be obtained.

getServletClass

public static java.lang.Class<?> getServletClass()
Gets the servelet class if this application is running as a servelet

Returns:
The servelet class if this application is running as a servelet

getServletClassName

public static java.lang.String getServletClassName()
Returns the Servlet class name

Returns:
The Servlet class name

main

public static void main(java.lang.String[] argv)
Command-line entry point (testing/debugging purposes)

Parameters:
argv - The command-line arguments