info.magnolia.cms.util
Class ConfigUtil

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

public class ConfigUtil
extends 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 InputStream getConfigFile(String fileName)
          Deprecated. since 4.0 - use getTokenizedConfigFile
static String getTokenizedConfigFile(String fileName)
           
static String replaceTokens(InputStream stream)
          Deprecated. since 4.0 - use getTokenizedConfigFile
static String replaceTokens(String config)
          Replace tokens in a string.
static Document string2DOM(String xml)
          Deprecated. since 4.0 - not used
static Document string2DOM(String xml, Map<String,String> dtds)
          Uses a map to find dtds in the resources.
static org.jdom.Document string2JDOM(String xml)
          Convert the string to a JDOM Document.
static org.jdom.Document string2JDOM(String xml, 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 String getTokenizedConfigFile(String fileName)
                                     throws IOException
Throws:
IOException

getConfigFile

public static InputStream getConfigFile(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 String replaceTokens(InputStream stream)
                            throws IOException
Deprecated. since 4.0 - use getTokenizedConfigFile

Read the stream and replace tokens.

Throws:
IOException

replaceTokens

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

Parameters:
config -
Returns:
Throws:
IOException

string2DOM

public static Document string2DOM(String xml)
                           throws ParserConfigurationException,
                                  SAXException,
                                  IOException
Deprecated. since 4.0 - not used

Convert the string to an DOM Document.

Throws:
ParserConfigurationException
SAXException
IOException

string2JDOM

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

Throws:
org.jdom.JDOMException
IOException

string2JDOM

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

Uses a map to find the dtds in the resources.

Throws:
org.jdom.JDOMException
IOException

string2DOM

public static Document string2DOM(String xml,
                                  Map<String,String> dtds)
                           throws ParserConfigurationException,
                                  SAXException,
                                  IOException
Uses a map to find dtds in the resources.

Parameters:
xml -
dtds -
Returns:
Throws:
ParserConfigurationException
SAXException
IOException


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