org.wcb.autohome.util
Class HAConfigLoader

java.lang.Object
  extended byorg.wcb.autohome.util.HAConfigLoader

public class HAConfigLoader
extends java.lang.Object

Project: Alice X10 Interface Filename: $Id: HAConfigLoader.java,v 1.11 2004/02/02 23:41:31 wbogaardt Exp $ Abstract: Server Config file loader

Version:
1.1
Author:
wbogaardt

Field Summary
static java.lang.String sDEFAULT_FILENAME
           
static java.lang.String sFILE_HEADER
           
 
Constructor Summary
HAConfigLoader()
           
HAConfigLoader(java.lang.String fileName)
           
HAConfigLoader(java.lang.String fileName, java.lang.String directory)
           
 
Method Summary
 java.lang.Object getObject(java.lang.Object propName)
          This returns the object, which is usually a string from the property file
 java.util.Properties getProperties()
          Gets the properties from the file system and returns it as a properties hash.
 java.lang.String getProperty(java.lang.String propName)
          Gets the value of a specified key name in the properties hash.
 boolean isEmpty(java.lang.String propName)
          Returns true if the specified property is empty.
 java.util.Properties load(java.lang.String directory, java.lang.String file)
          Load the specified properties file.
 void saveProperties()
          Saves the properties file to the file system.
 void setProperties(java.util.Properties newProp)
          Sets the properties object to the passed in value.
 void setProperty(java.lang.String prop, java.lang.Object value)
          This returns an object, which is a string from the property file based on a string of the key name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sDEFAULT_FILENAME

public static final java.lang.String sDEFAULT_FILENAME
See Also:
Constant Field Values

sFILE_HEADER

public static final java.lang.String sFILE_HEADER
See Also:
Constant Field Values
Constructor Detail

HAConfigLoader

public HAConfigLoader()

HAConfigLoader

public HAConfigLoader(java.lang.String fileName)

HAConfigLoader

public HAConfigLoader(java.lang.String fileName,
                      java.lang.String directory)
Method Detail

load

public java.util.Properties load(java.lang.String directory,
                                 java.lang.String file)
Load the specified properties file. If the file does not exist, a default file will be created.


getProperties

public java.util.Properties getProperties()
Gets the properties from the file system and returns it as a properties hash.

Returns:
Properties hash of saved configuration.

isEmpty

public boolean isEmpty(java.lang.String propName)
Returns true if the specified property is empty.

Parameters:
propName - property key to check
Returns:
true if property is empty.

getProperty

public java.lang.String getProperty(java.lang.String propName)
Gets the value of a specified key name in the properties hash.

Parameters:
propName - key name
Returns:
string value

getObject

public java.lang.Object getObject(java.lang.Object propName)
This returns the object, which is usually a string from the property file

Parameters:
propName -
Returns:
value Object of the key object.

setProperty

public void setProperty(java.lang.String prop,
                        java.lang.Object value)
This returns an object, which is a string from the property file based on a string of the key name.

Parameters:
prop - String representation of the key name
value - OBject, which is a string.

setProperties

public void setProperties(java.util.Properties newProp)
Sets the properties object to the passed in value.

Parameters:
newProp - New properties hash.

saveProperties

public void saveProperties()
Saves the properties file to the file system.



Copyright © 1999-2004 Walter Bogaardt. All Rights Reserved.