org.wings.template
Class CachedFileTemplateSource

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

public class CachedFileTemplateSource
extends FileTemplateSource

A CachedFileDataSource implements a DataSource for a file, but caches small ones.

Author:
Henner Zeller
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.wings.template.FileTemplateSource
canonicalName
 
Constructor Summary
CachedFileTemplateSource(File f)
           
CachedFileTemplateSource(URL url)
           
 
Method Summary
 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 org.wings.template.FileTemplateSource
getCanonicalName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CachedFileTemplateSource

public CachedFileTemplateSource(File f)
                         throws IOException
Throws:
IOException

CachedFileTemplateSource

public CachedFileTemplateSource(URL url)
                         throws IOException
Throws:
IOException
Method Detail

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
Overrides:
lastModified in class FileTemplateSource
Returns:
long a modification time

getInputStream

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

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


wingS Swings ;-)