com.armatiek.infofuze.config
Class Config

java.lang.Object
  extended by com.armatiek.infofuze.config.Config
All Implemented Interfaces:
org.xml.sax.ErrorHandler

public class Config
extends java.lang.Object
implements org.xml.sax.ErrorHandler

A singleton class that reads, validates and stores Infofuze's configuration file, infofuze-config.xml.

Author:
Maarten Kroon

Method Summary
 void error(org.xml.sax.SAXParseException exception)
           
 void fatalError(org.xml.sax.SAXParseException exception)
           
 java.io.File getConfigFile()
          Returns a file object denoting the configuration file infofuze-config.xml
 java.io.File getConfigSchema()
          Returns a file object denoting the XML Schema file for infofuze-config.xml
 java.lang.String getDefaultSourceName()
           
 int getDeferredOutputStreamThreshold()
           
 java.io.File getHomeDir()
          Returns a file object denoting the Infofuze home directory
static Config getInstance()
          Returns the singleton Config instance.
 java.io.File getJobsFile()
          Returns a file object denoting the Quartz jobs configuration file jobs.xml
 java.lang.String getMimeType(java.lang.String name)
          Returns the mime type for a file with specified name using Apache Tika.
 java.io.File getTasksFile()
          Returns a file object denoting the tasks configuration file tasks.xml
 boolean isDevelopmentMode()
          Returns whether this Infofuze instance is in development mode or not.
 void warning(org.xml.sax.SAXParseException exception)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static Config getInstance()
Returns the singleton Config instance.


getConfigFile

public java.io.File getConfigFile()
                           throws java.io.FileNotFoundException
Returns a file object denoting the configuration file infofuze-config.xml

Throws:
java.io.FileNotFoundException

getJobsFile

public java.io.File getJobsFile()
                         throws java.io.FileNotFoundException
Returns a file object denoting the Quartz jobs configuration file jobs.xml

Throws:
java.io.FileNotFoundException

getTasksFile

public java.io.File getTasksFile()
                          throws java.io.FileNotFoundException
Returns a file object denoting the tasks configuration file tasks.xml

Throws:
java.io.FileNotFoundException

getConfigSchema

public java.io.File getConfigSchema()
                             throws java.io.FileNotFoundException
Returns a file object denoting the XML Schema file for infofuze-config.xml

Throws:
java.io.FileNotFoundException

getHomeDir

public java.io.File getHomeDir()
Returns a file object denoting the Infofuze home directory

Throws:
java.io.FileNotFoundException

getMimeType

public java.lang.String getMimeType(java.lang.String name)
Returns the mime type for a file with specified name using Apache Tika.

Parameters:
name - The name to get the mime type for

isDevelopmentMode

public boolean isDevelopmentMode()
Returns whether this Infofuze instance is in development mode or not.


getDefaultSourceName

public java.lang.String getDefaultSourceName()

getDeferredOutputStreamThreshold

public int getDeferredOutputStreamThreshold()

error

public void error(org.xml.sax.SAXParseException exception)
           throws org.xml.sax.SAXException
Specified by:
error in interface org.xml.sax.ErrorHandler
Throws:
org.xml.sax.SAXException

fatalError

public void fatalError(org.xml.sax.SAXParseException exception)
                throws org.xml.sax.SAXException
Specified by:
fatalError in interface org.xml.sax.ErrorHandler
Throws:
org.xml.sax.SAXException

warning

public void warning(org.xml.sax.SAXParseException exception)
             throws org.xml.sax.SAXException
Specified by:
warning in interface org.xml.sax.ErrorHandler
Throws:
org.xml.sax.SAXException