cafe.settings
Class Settings

java.lang.Object
  extended by cafe.settings.Settings
All Implemented Interfaces:
Configuration

public class Settings
extends java.lang.Object
implements Configuration

This class implements Configuration interface. It provides settings to other components by parsing configuration files.

Version:
0.3
Author:
Markus Penttila

Constructor Summary
Settings()
          Constructs new Settings and checks that the main settings file settings.xml is available
Settings(java.lang.String settingsFileUri)
          Constructs new Settings and checks that the main settings file is available at the given location.
 
Method Summary
 AuthenticationSettings getAuthenticationSettings()
           
 DBSettings getDBSettings()
          Parses database settings from settings file.
 FingerprintSettings getFingerprintSettings()
          Parses settings for the fingerprint authentication component from settings file.
 GUISettings getGUISettings()
          Parses graphical user interface settings from settings file.
 java.lang.String getProperty(java.lang.String propertyName)
          Gets a property from property file
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Settings

public Settings()
         throws java.io.FileNotFoundException,
                java.io.IOException,
                java.util.InvalidPropertiesFormatException
Constructs new Settings and checks that the main settings file settings.xml is available

Throws:
java.io.FileNotFoundException - if settings file is not found.
java.io.IOException - if reading from the file results in an IOException.
java.util.InvalidPropertiesFormatException - Data on file does not constitute a valid XML document with the mandated document type.

Settings

public Settings(java.lang.String settingsFileUri)
         throws java.io.FileNotFoundException,
                java.io.IOException,
                java.util.InvalidPropertiesFormatException
Constructs new Settings and checks that the main settings file is available at the given location.

Parameters:
settingsFileUri - Path to the main settings file.
Throws:
java.io.FileNotFoundException - if settings file is not found.
java.io.IOException - if reading from the file results in an IOException.
java.util.InvalidPropertiesFormatException - Data on file does not constitute a valid XML document with the mandated document type.
Method Detail

getProperty

public java.lang.String getProperty(java.lang.String propertyName)
Gets a property from property file

Returns:
String value from property file, if property not found, returns empty string

getDBSettings

public DBSettings getDBSettings()
                         throws java.io.FileNotFoundException,
                                java.io.IOException,
                                java.util.InvalidPropertiesFormatException
Parses database settings from settings file.

Specified by:
getDBSettings in interface Configuration
Returns:
DBSettings containing the settings.
Throws:
java.io.FileNotFoundException - if settings file is not found.
java.io.IOException - if reading from the file results in an IOException.
java.util.InvalidPropertiesFormatException - Data on file does not constitute a valid XML document with the mandated document type.

getGUISettings

public GUISettings getGUISettings()
                           throws java.io.FileNotFoundException,
                                  java.io.IOException,
                                  java.util.InvalidPropertiesFormatException
Parses graphical user interface settings from settings file.

Specified by:
getGUISettings in interface Configuration
Returns:
GUISettings containing the settings.
Throws:
java.io.FileNotFoundException - if settings file is not found.
java.io.IOException - if reading from the file results in an IOException.
java.util.InvalidPropertiesFormatException - Data on file does not constitute a valid XML document with the mandated document type.

getFingerprintSettings

public FingerprintSettings getFingerprintSettings()
Parses settings for the fingerprint authentication component from settings file.

Specified by:
getFingerprintSettings in interface Configuration
Returns:
FingerprintSettings containing the settings.

getAuthenticationSettings

public AuthenticationSettings getAuthenticationSettings()
Specified by:
getAuthenticationSettings in interface Configuration