org.wings.template
Class FileTemplateSource

java.lang.Object
  extended by org.wings.template.FileTemplateSource
All Implemented Interfaces:
Serializable, TemplateSource
Direct Known Subclasses:
CachedFileTemplateSource

public class FileTemplateSource
extends Object
implements TemplateSource, Serializable

A FileDataSource implements a TemplateSource for a file.

Author:
Henner Zeller
See Also:
Serialized Form

Field Summary
protected  String canonicalName
           
 
Constructor Summary
FileTemplateSource(File f)
           
 
Method Summary
 String getCanonicalName()
          Returns a canonical name of this DataSource.
 InputStream getInputStream()
          Gets an InputStream of the File.
 long lastModified()
          Returns the time the content of this File was last modified.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

canonicalName

protected String canonicalName
Constructor Detail

FileTemplateSource

public FileTemplateSource(File f)
Method Detail

getCanonicalName

public String getCanonicalName()
Returns a canonical name of this DataSource.

Specified by:
getCanonicalName in interface TemplateSource
Returns:
the canonical name of the source. like 'file:/web/template.html'

lastModified

public long lastModified()
Returns the time the content of this File was last modified.

The return value is used to decide whether to reparse a Source or not. Reparsing is done if the value returned here differs from the value returned at the last processing time.

Specified by:
lastModified in interface TemplateSource
Returns:
long a modification time

getInputStream

public InputStream getInputStream()
                           throws IOException
Gets an InputStream of the File.

Specified by:
getInputStream in interface TemplateSource
Returns:
an InputStream the content of the template is read from.
Throws:
IOException


wingS Swings ;-)