Class ProjectConfig

java.lang.Object
  extended by ProjectConfig

public class ProjectConfig
extends java.lang.Object

Configuration class that dynamically holds any variable you wish in the properties file.


Constructor Summary
ProjectConfig()
          Default Constructor.
ProjectConfig(java.lang.String name, java.lang.String homeDir)
          Constructor that sets the only two required parameters of the ProjectConfig.
 
Method Summary
 java.lang.String get(java.lang.String key)
          Gets the property associated with the key.
 boolean loadSettings(java.lang.String file)
          Loads all the settings from a properties file.
 void saveSettings()
          Saves the settings of this class to a properties file.
 void set(java.lang.String key, java.lang.String content)
          Sets a key/property pair, then saves it to a properties file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProjectConfig

public ProjectConfig()
Default Constructor.


ProjectConfig

public ProjectConfig(java.lang.String name,
                     java.lang.String homeDir)
Constructor that sets the only two required parameters of the ProjectConfig.

Parameters:
name - The name of the project.
homeDir - The absolute path of the project's home directory.
Method Detail

get

public java.lang.String get(java.lang.String key)
Gets the property associated with the key.

Parameters:
key - Key of the property you want.
Returns:
The property if it exists, a blank string otherwise, will not return null.

set

public void set(java.lang.String key,
                java.lang.String content)
Sets a key/property pair, then saves it to a properties file.

Parameters:
key - The key to assign the property to.
content - They property to put into the specified key value.

loadSettings

public boolean loadSettings(java.lang.String file)
Loads all the settings from a properties file.

Parameters:
file - File to load from.
Returns:
True if succesfull, false otherwise.

saveSettings

public void saveSettings()
Saves the settings of this class to a properties file. the file made is homeDir/name.side