Hilbert II - Version 0.03.08

org.qedeq.kernel.config
Class QedeqConfig

java.lang.Object
  extended byorg.qedeq.kernel.config.QedeqConfig

public class QedeqConfig
extends Object

This class gives a type save access to properties of the application.

Version:
$Revision: 1.5 $

Constructor Summary
QedeqConfig(File configFile, String description, File basisDirectory)
          Constructor.
 
Method Summary
 File createAbsolutePath(String path)
          Get file path starting from basis directory of this application.
 File getBasisDirectory()
          Get basis directory of this application.
 File getBufferDirectory()
          Get local file directory for module buffering.
 File getGenerationDirectory()
          Get local file directory to save generated files in.
protected  String getKeyValue(String key)
          Get value for given key.
protected  String getKeyValue(String key, String defaultValue)
          Get value for given key.
 File getLocalModulesDirectory()
          Get directory for newly created QEDEQ module files.
 String getLogFile()
          Get local file location for log file.
 String[] getModuleHistory()
          Get history of modules, which were tried to load.
 String[] getPreviouslyCheckedModules()
          Get list of previously checked modules.
 boolean isAutoReloadLastSessionChecked()
          Get auto reload of last session successfully loaded modules.
 boolean isOldHtml()
          Should old HTML code be generated?
 void saveModuleHistory(List modules)
          Save history of modules, which were tried to load.
 void setAutoReloadLastSessionChecked(boolean mode)
          Set auto reload checked modules of last session mode.
 void setBufferDirectory(File location)
          Set local file directory for module buffering.
 void setGenerationDirectory(File location)
          Set local file directory for generated files.
protected  void setKeyValue(String key, String value)
          Set value for given key.
 void setLoadedModules(ModuleAddress[] moduleAddresses)
          Set successfully list of successfully loaded QEDEQ modules.
 void setLocalModulesDirectory(File location)
          Set directory for newly created module files.
 void setOldHtml(boolean mode)
          Set old HTML code generation flag.
 void store()
          Store properties in config file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QedeqConfig

public QedeqConfig(File configFile,
                   String description,
                   File basisDirectory)
            throws IOException
Constructor.

Parameters:
configFile - Config file.
description - Config file description.
basisDirectory - Basis directory of application for all variable data. Basis for all relative paths
Throws:
IOException - Config file couldn't be loaded.
Method Detail

store

public final void store()
                 throws IOException
Store properties in config file.

Throws:
IOException

getGenerationDirectory

public final File getGenerationDirectory()
Get local file directory to save generated files in.

Returns:
Generation directory.

setGenerationDirectory

public final void setGenerationDirectory(File location)
Set local file directory for generated files.

Parameters:
location - generation directory.

getBufferDirectory

public final File getBufferDirectory()
Get local file directory for module buffering.

Returns:
Buffer directory.

setBufferDirectory

public final void setBufferDirectory(File location)
Set local file directory for module buffering. After changing this location the buffer should eventually be cleared.

Parameters:
location - buffer directory.

getLocalModulesDirectory

public final File getLocalModulesDirectory()
Get directory for newly created QEDEQ module files.

Returns:
Directory for newly created QEDEQ modules.

setLocalModulesDirectory

public final void setLocalModulesDirectory(File location)
Set directory for newly created module files. After changing this location the buffer should eventually be cleared.

Parameters:
location - Buffer directory.

getLogFile

public final String getLogFile()
Get local file location for log file.

Returns:
Log file path.

getModuleHistory

public final String[] getModuleHistory()
Get history of modules, which were tried to load.

Returns:
list of modules.

saveModuleHistory

public final void saveModuleHistory(List modules)
Save history of modules, which were tried to load.

Parameters:
modules - list of modules.

getPreviouslyCheckedModules

public final String[] getPreviouslyCheckedModules()
Get list of previously checked modules.

Returns:
list of modules.

setLoadedModules

public final void setLoadedModules(ModuleAddress[] moduleAddresses)
Set successfully list of successfully loaded QEDEQ modules.

Parameters:
moduleAddresses - This modules were successfully checked.

getBasisDirectory

public final File getBasisDirectory()
Get basis directory of this application.

Returns:
Basis directory of application for all variable data. Basis for all relative paths.

createAbsolutePath

public final File createAbsolutePath(String path)
Get file path starting from basis directory of this application.

Parameters:
path - Go to this path starting from basis directory.
Returns:
File path resolved against basis application directory.

isAutoReloadLastSessionChecked

public boolean isAutoReloadLastSessionChecked()
Get auto reload of last session successfully loaded modules.

Returns:
auto reload enabled?

setAutoReloadLastSessionChecked

public final void setAutoReloadLastSessionChecked(boolean mode)
Set auto reload checked modules of last session mode.

Parameters:
mode - enable auto reload?

isOldHtml

public final boolean isOldHtml()
Should old HTML code be generated?

Returns:
Old HTML code?

setOldHtml

public final void setOldHtml(boolean mode)
Set old HTML code generation flag.

Parameters:
mode - Set old HTML code generation?

getKeyValue

protected String getKeyValue(String key)
Get value for given key.

Parameters:
key - Get value for this key.
Returns:
Value, maybe null.

getKeyValue

protected String getKeyValue(String key,
                             String defaultValue)
Get value for given key.

Parameters:
key - Get value for this key.
defaultValue - Default value..
Returns:
Value. If value for key is originally null defaultValue is returned..

setKeyValue

protected void setKeyValue(String key,
                           String value)
Set value for given key.

Parameters:
key - For this key.
value - Set this value.

Hilbert II - Version 0.03.08

©left GNU General Public Licence
All Rights Reserved.