org.weborganic.bastille.web
Class TemplateFile

java.lang.Object
  extended by org.weborganic.bastille.web.TemplateFile

public final class TemplateFile
extends Object

A utility class for templates files.

Since:
0.6.0

Method Summary
static String getETag(String name, boolean reload)
          Returns the Etag for the given template file name.
static File getFile(String name, boolean reload)
          Returns the template file.
static void write(XMLWriter xml, File file)
          Write the specified file on the given XML writer.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

write

public static void write(XMLWriter xml,
                         File file)
                  throws IOException
Write the specified file on the given XML writer.

Parameters:
xml - The XML writer the file should be written to.
file - The file to write.
Throws:
IOException - If Berlioz was unable to write on the XML writer.

getFile

public static File getFile(String name,
                           boolean reload)
Returns the template file.

Parameters:
name - The name of the template file property ("header", "footer", etc...).
reload - Whether to reload the configuration.
Returns:
the corresponding file.

getETag

public static String getETag(String name,
                             boolean reload)
Returns the Etag for the given template file name.

The ETag is a weak etag based on the length and last modified date of both the config file and the actual file to load.

Parameters:
name - the name of the file property ("header", "footer", etc...)
reload - Whether to reload the configuration.
Returns:
the Etag for the given template file name.