info.magnolia.cms.util
Class ConfigUtil

java.lang.Object
  extended by info.magnolia.cms.util.ConfigUtil

public class ConfigUtil
extends java.lang.Object

Util used to process config files.

Version:
$Id: ConfigUtil.java 41137 2011-01-06 18:19:25Z gjoseph $

Nested Class Summary
static class ConfigUtil.MapDTDEntityResolver
          EntityResolver using a Map to resources.
 
Constructor Summary
ConfigUtil()
           
 
Method Summary
static java.io.InputStream getConfigFile(java.lang.String fileName)
          Deprecated. since 4.0 - use getTokenizedConfigFile
static java.lang.String getTokenizedConfigFile(java.lang.String fileName)
           
static java.lang.String replaceTokens(java.io.InputStream stream)
          Deprecated. since 4.0 - use getTokenizedConfigFile
static java.lang.String replaceTokens(java.lang.String config)
          Replace tokens in a string.
static org.w3c.dom.Document string2DOM(java.lang.String xml)
          Deprecated. since 4.0 - not used
static org.w3c.dom.Document string2DOM(java.lang.String xml, java.util.Map<java.lang.String,java.lang.String> dtds)
          Uses a map to find dtds in the resources.
static org.jdom.Document string2JDOM(java.lang.String xml)
          Convert the string to a JDOM Document.
static org.jdom.Document string2JDOM(java.lang.String xml, java.util.Map dtds)
          Deprecated. since 4.0 - not used
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConfigUtil

public ConfigUtil()
Method Detail

getTokenizedConfigFile

public static java.lang.String getTokenizedConfigFile(java.lang.String fileName)
                                               throws java.io.IOException
Throws:
java.io.IOException

getConfigFile

public static java.io.InputStream getConfigFile(java.lang.String fileName)
Deprecated. since 4.0 - use getTokenizedConfigFile

Try to get the file. Get it first in the file system, then from the resources

Parameters:
fileName -
Returns:
the input stream

replaceTokens

public static java.lang.String replaceTokens(java.io.InputStream stream)
                                      throws java.io.IOException
Deprecated. since 4.0 - use getTokenizedConfigFile

Read the stream and replace tokens.

Throws:
java.io.IOException

replaceTokens

public static java.lang.String replaceTokens(java.lang.String config)
                                      throws java.io.IOException
Replace tokens in a string.

Parameters:
config -
Returns:
Throws:
java.io.IOException

string2DOM

public static org.w3c.dom.Document string2DOM(java.lang.String xml)
                                       throws javax.xml.parsers.ParserConfigurationException,
                                              org.xml.sax.SAXException,
                                              java.io.IOException
Deprecated. since 4.0 - not used

Convert the string to an DOM Document.

Throws:
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
java.io.IOException

string2JDOM

public static org.jdom.Document string2JDOM(java.lang.String xml)
                                     throws org.jdom.JDOMException,
                                            java.io.IOException
Convert the string to a JDOM Document.

Throws:
org.jdom.JDOMException
java.io.IOException

string2JDOM

public static org.jdom.Document string2JDOM(java.lang.String xml,
                                            java.util.Map dtds)
                                     throws org.jdom.JDOMException,
                                            java.io.IOException
Deprecated. since 4.0 - not used

Uses a map to find the dtds in the resources.

Throws:
org.jdom.JDOMException
java.io.IOException

string2DOM

public static org.w3c.dom.Document string2DOM(java.lang.String xml,
                                              java.util.Map<java.lang.String,java.lang.String> dtds)
                                       throws javax.xml.parsers.ParserConfigurationException,
                                              org.xml.sax.SAXException,
                                              java.io.IOException
Uses a map to find dtds in the resources.

Parameters:
xml -
dtds -
Returns:
Throws:
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
java.io.IOException


Copyright © 2003-2011 Magnolia International Ltd.. All Rights Reserved.