org.wdssii.core
Class W2Config

java.lang.Object
  extended by org.wdssii.core.W2Config

public class W2Config
extends Object

This configuration class finds and uses the pertinent configuration information from the WDSS2/w2config directory.

Version:
$Id: W2Config.java,v 1.5 2007/10/11 15:23:01 lakshman Exp $
Author:
Lakshman

Field Summary
private static List<String> configDirectories
           
private static org.apache.commons.logging.Log log
           
 
Constructor Summary
W2Config()
           
 
Method Summary
private static boolean addDir(String dir, List<String> configDirectories)
           
static File getFile(String filename)
          will search the config directories for the first file that matches the given filename.
static Element getFileElement(String filename)
          Parse and return the XML Dom element corresponding to a partial file name.
private static List<String> loadConfigDirectories()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static org.apache.commons.logging.Log log

configDirectories

private static List<String> configDirectories
Constructor Detail

W2Config

public W2Config()
Method Detail

addDir

private static boolean addDir(String dir,
                              List<String> configDirectories)

loadConfigDirectories

private static List<String> loadConfigDirectories()

getFile

public static File getFile(String filename)
                    throws ConfigurationException
will search the config directories for the first file that matches the given filename. can return null. For example, passing colormaps/Reflectivity, you will get a File corresponding to /etc/w2config/colormaps/Reflectivity

Throws:
ConfigurationException

getFileElement

public static Element getFileElement(String filename)
                              throws ConfigurationException
Parse and return the XML Dom element corresponding to a partial file name. For example, passing colormaps/Reflectivity, you may get the DOM element from /etc/w2config/colormaps/Reflectivity

Throws:
ConfigurationException