CFEngine API

org.recommender.server
Class SystemProperties

java.lang.Object
  |
  +--org.recommender.server.SystemProperties

public class SystemProperties
extends java.lang.Object

SystemProperties loads, maintains, and provides accessors for all CFServer properties. Author: Daniel Lowd <dlowd@cs.orst.edu>


Constructor Summary
SystemProperties()
           
 
Method Summary
static boolean getBoolean(java.lang.String propName)
          Get a property value as a boolean.
static boolean getBoolean(java.lang.String propName, boolean defaultValue)
          Get a property value as a boolean.
static float getFloat(java.lang.String propName)
          Get a property value as a float.
static float getFloat(java.lang.String propName, float defaultValue)
          Get a property value as a float.
static int getInt(java.lang.String propName)
          Get a property value as an int.
static int getInt(java.lang.String propName, int defaultValue)
          Get a property value as an int.
static java.lang.String getString(java.lang.String propName)
          Get a property value as a string.
static java.lang.String getString(java.lang.String propName, java.lang.String defaultValue)
          Get a property value as a string.
static void loadProperties(java.lang.String filename)
          Load all server properties from a file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SystemProperties

public SystemProperties()
Method Detail

loadProperties

public static void loadProperties(java.lang.String filename)
Load all server properties from a file.

Parameters:
filename - path to a file containing the server properties

getString

public static java.lang.String getString(java.lang.String propName,
                                         java.lang.String defaultValue)
Get a property value as a string. Returns the user-provided default value if the property is unset. Removes leading and trailing whitespace from property value.

Parameters:
propName -
defaultValue -
Returns:
the String with the propName or defaultValue

getString

public static java.lang.String getString(java.lang.String propName)
Get a property value as a string. Returns null if the property is unset. Removes leading and trailing whitespace from property value.

Parameters:
propName -
Returns:
the String with the propName or null

getBoolean

public static boolean getBoolean(java.lang.String propName,
                                 boolean defaultValue)
Get a property value as a boolean. Returns the user-provided default value if the property is unset.

Parameters:
propName -
defaultValue -
Returns:
boolean

getBoolean

public static boolean getBoolean(java.lang.String propName)
Get a property value as a boolean. Returns false if the property is unset.

Parameters:
propName -

getInt

public static int getInt(java.lang.String propName,
                         int defaultValue)
Get a property value as an int. Returns the user-provided default value if the property is unset.

Parameters:
propName -
defaultValue -
Returns:
the int value of the property or defaultValue

getInt

public static int getInt(java.lang.String propName)
Get a property value as an int. Returns 0 if the property is unset.

Parameters:
propName -
Returns:
the int value of the property or 0

getFloat

public static float getFloat(java.lang.String propName,
                             float defaultValue)
Get a property value as a float. Returns the user-provided default value if the property is unset.

Parameters:
propName -
defaultValue -
Returns:
the float value of the property or null

getFloat

public static float getFloat(java.lang.String propName)
Get a property value as a float. Returns 0 if the property is unset.

Parameters:
propName -
Returns:
the float value of the property or 0

CFEngine API

Copyright © 2003 - Oregon State University www.orst.edu