org.weborganic.bastille.xml
Class XMLHelper

java.lang.Object
  extended by org.weborganic.bastille.xml.XMLHelper

public final class XMLHelper
extends Object

Utility class providing useful functions for content generators.

Should not be public.

Since:
0.6.0

Field Summary
static String CACHE_NAME
          Name of the cache.
 
Method Summary
static Cache initCache()
          Initialises the cache.
static String load(File file, ContentRequest req, Logger logger)
          Loads the specified XML file and returns it as a string.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CACHE_NAME

public static final String CACHE_NAME
Name of the cache.

See Also:
Constant Field Values
Method Detail

initCache

public static Cache initCache()
Initialises the cache.

Returns:
the Cache instance.

load

public static String load(File file,
                          ContentRequest req,
                          Logger logger)
                   throws IOException
Loads the specified XML file and returns it as a string.

Parameters:
file - The file to load
req - The content request to display the file in case of error.
logger - To log info on the correct logger.
Returns:
the content of the XML file.
Throws:
IOException - If an error occurs while trying to read or write the XML.