org.exist.util
Class Configuration

java.lang.Object
  extended byorg.exist.util.Configuration
All Implemented Interfaces:
org.xml.sax.ErrorHandler

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


Nested Class Summary
static class Configuration.SystemTaskConfig
           
 
Field Summary
protected  javax.xml.parsers.DocumentBuilder builder
           
protected  java.util.HashMap config
           
protected static java.io.File existHome
           
protected static java.lang.String file
           
 
Constructor Summary
Configuration()
           
Configuration(java.lang.String configFilename)
           
Configuration(java.lang.String configFilename, java.lang.String existHomeDirname)
           
 
Method Summary
 void error(org.xml.sax.SAXParseException exception)
           
 void fatalError(org.xml.sax.SAXParseException exception)
           
static java.io.File getExistHome()
          Returns a file handle for eXist's home directory.
static java.io.File getExistHome(java.lang.String path)
          Returns a file handle for eXist's home directory.
 int getInteger(java.lang.String name)
           
static java.lang.String getPath()
          Returns the absolut path to the configuration file.
 java.lang.Object getProperty(java.lang.String name)
           
 boolean hasProperty(java.lang.String name)
           
static java.io.File lookup(java.lang.String path)
          Returns a file handle for the given path, while path specifies the path to an eXist configuration file or directory.
static java.io.File lookup(java.lang.String path, java.lang.String parent)
          Returns a file handle for the given path, while path specifies the path to an eXist configuration file or directory.
 void setProperty(java.lang.String name, java.lang.Object obj)
           
 void warning(org.xml.sax.SAXParseException exception)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

file

protected static java.lang.String file

existHome

protected static java.io.File existHome

builder

protected javax.xml.parsers.DocumentBuilder builder

config

protected java.util.HashMap config
Constructor Detail

Configuration

public Configuration()
              throws DatabaseConfigurationException

Configuration

public Configuration(java.lang.String configFilename)
              throws DatabaseConfigurationException

Configuration

public Configuration(java.lang.String configFilename,
                     java.lang.String existHomeDirname)
              throws DatabaseConfigurationException
Method Detail

getProperty

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

hasProperty

public boolean hasProperty(java.lang.String name)

setProperty

public void setProperty(java.lang.String name,
                        java.lang.Object obj)

getInteger

public int getInteger(java.lang.String name)

getPath

public static java.lang.String getPath()
Returns the absolut path to the configuration file.

Returns:
the path to the configuration file

lookup

public static java.io.File lookup(java.lang.String path)
Returns a file handle for the given path, while path specifies the path to an eXist configuration file or directory.
Note that relative paths are being interpreted relative to exist.home or the current working directory, in case exist.home was not set.

Parameters:
path - the file path
Returns:
the file handle

lookup

public static java.io.File lookup(java.lang.String path,
                                  java.lang.String parent)
Returns a file handle for the given path, while path specifies the path to an eXist configuration file or directory.
If parent is null, then relative paths are being interpreted relative to exist.home or the current working directory, in case exist.home was not set.

Parameters:
path - path to the file or directory
parent - parent directory used to lookup path
Returns:
the file handle

getExistHome

public static java.io.File getExistHome()
Returns a file handle for eXist's home directory.

If either none of the directories identified by the system properties exist.home and user.home exist or none of them contain a configuration file, this method returns null.

Returns:
the file handle or null

getExistHome

public static java.io.File getExistHome(java.lang.String path)
Returns a file handle for eXist's home directory. Order of tests is designed with the idea, the more precise it is, the more the developper know what he is doing
  1. proposed path : if exists
  2. exist.home : if exists
  3. user.home : if exists, with a conf.xml file
  4. user.dir : if exists, with a conf.xml file

Parameters:
path - path to eXist home directory
Returns:
the file handle or null

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


<oXygen/> XML Editor provides support for editing and debugging XQuery expressions against the eXist XML Database.