org.apache.uima.tools.cfe.config.util
Class ConfigResourceUtil

java.lang.Object
  extended by org.apache.uima.tools.cfe.config.util.ConfigResourceUtil

public class ConfigResourceUtil
extends Object

The utility class for loading and storing SDO instances as XML files.


Constructor Summary
ConfigResourceUtil()
          The default constructor.
 
Method Summary
static ConfigResourceUtil getInstance()
          Return the single instance of this class.
 DocumentRoot load(InputStream istream)
          Load an existing XML file.
 DocumentRoot load(String filename)
          Load an existing XML file.
 void save(DocumentRoot documentRoot, OutputStream ostream)
          Save as an XML output stream.
 void save(DocumentRoot documentRoot, String filename)
          Save as an XML file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConfigResourceUtil

public ConfigResourceUtil()
The default constructor.

Method Detail

getInstance

public static ConfigResourceUtil getInstance()
Return the single instance of this class.


load

public DocumentRoot load(String filename)
                  throws IOException
Load an existing XML file.

Parameters:
filename - the absolute path name of the XML file to be loaded.
Returns:
DocumentRoot
Throws:
IOException - failed loading from an XML file.

load

public DocumentRoot load(InputStream istream)
                  throws IOException
Load an existing XML file.

Parameters:
istream - the InputStream to load the XML content from.
Returns:
DocumentRoot
Throws:
IOException - failed loading from an XML file.

save

public void save(DocumentRoot documentRoot,
                 String filename)
          throws IOException
Save as an XML file.

Parameters:
documentRoot - the document root of the SDO instances.
filename - the absolute path name of the XML file to be created.
Throws:
IOException - failed storing to an XML file.

save

public void save(DocumentRoot documentRoot,
                 OutputStream ostream)
          throws IOException
Save as an XML output stream.

Parameters:
documentRoot - the document root of the SDO instances.
ostream - the OutputStream where the XML content is to be written.
Throws:
IOException - failed storing to an XML file.


Copyright © 2006-2011 The Apache Software Foundation. All Rights Reserved.