com.groiss.component
Class Configuration

java.lang.Object
  extended by com.groiss.component.Configuration

public class Configuration
extends java.lang.Object

This class handles the access to the configuration.


Method Summary
static Configuration create(java.lang.String id)
           
 java.lang.String demansch(java.lang.String arg)
          Inverse function to mansch
static Configuration get()
           
static Configuration get(java.lang.String id)
           
 java.lang.String getFileName()
           
 java.lang.String getId()
           
 java.lang.String getMangledProperty(java.lang.String name)
           
 java.util.Properties getProperties()
           
 java.lang.String getProperty(java.lang.String name)
           
 java.lang.String getProperty(java.lang.String name, java.lang.String defValue)
          Returns the value of the spaceified configuration key or the defValue, if the configuration entry is not found.
 void init(java.lang.String filename)
           
static void loadTopLevel(java.lang.String filename)
           
 java.lang.String mansch(java.lang.String arg)
          This method makes a string unreadable.
 void reload()
           
 void setMangledProperty(java.lang.String name, java.lang.String value)
           
 void setProperty(java.lang.String name, java.lang.String value)
           
 void setSystemProps()
           
 void store()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

create

public static Configuration create(java.lang.String id)

get

public static Configuration get(java.lang.String id)

get

public static Configuration get()

init

public void init(java.lang.String filename)
          throws java.io.IOException,
                 java.io.FileNotFoundException
Throws:
java.io.IOException
java.io.FileNotFoundException

reload

public void reload()
            throws java.io.IOException
Throws:
java.io.IOException

loadTopLevel

public static void loadTopLevel(java.lang.String filename)
                         throws java.io.IOException,
                                java.io.FileNotFoundException
Throws:
java.io.IOException
java.io.FileNotFoundException

setSystemProps

public void setSystemProps()

getFileName

public java.lang.String getFileName()

getId

public java.lang.String getId()

getProperty

public java.lang.String getProperty(java.lang.String name)

getProperty

public java.lang.String getProperty(java.lang.String name,
                                    java.lang.String defValue)
Returns the value of the spaceified configuration key or the defValue, if the configuration entry is not found.

Parameters:
name - the configuration entry key
defValue - the default value
Returns:
the value of the spaceified configuration key or the defValue, if the configuration entry is not found.

setProperty

public void setProperty(java.lang.String name,
                        java.lang.String value)

getMangledProperty

public java.lang.String getMangledProperty(java.lang.String name)

setMangledProperty

public void setMangledProperty(java.lang.String name,
                               java.lang.String value)

store

public void store()
           throws java.io.IOException
Throws:
java.io.IOException

mansch

public java.lang.String mansch(java.lang.String arg)
This method makes a string unreadable. Is is used to store passwords in a configuration file. It is not an encryption but is much better than storing the value unchanged.


demansch

public java.lang.String demansch(java.lang.String arg)
Inverse function to mansch


getProperties

public java.util.Properties getProperties()


Copyright © 2001-2006 Groiss Informatics GmbH. All Rights Reserved.