jon 00/11/07 15:11:46
Modified: src/java/org/apache/velocity/runtime/loader
FileTemplateLoader.java
Log:
added some docs
Revision Changes Path
1.8 +5 -4
jakarta-velocity/src/java/org/apache/velocity/runtime/loader/FileTemplateLoader.java
Index: FileTemplateLoader.java
===================================================================
RCS file:
/home/cvs/jakarta-velocity/src/java/org/apache/velocity/runtime/loader/FileTemplateLoader.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- FileTemplateLoader.java 2000/11/06 21:07:34 1.7
+++ FileTemplateLoader.java 2000/11/07 23:11:43 1.8
@@ -70,7 +70,7 @@
* That'll change once we decide how we want to do configuration
*
* @author Dave Bryson
- * $Revision: 1.7 $
+ * $Revision: 1.8 $
*/
public class FileTemplateLoader extends TemplateLoader
{
@@ -107,6 +107,9 @@
/**
* Fetch the template
+ * If caching is turned on, then it will get it from cache.
+ * otherwise, it will attempt to load it from the file
+ * @param name the name of the file
* @return Template
*/
public synchronized Template getTemplate( String name )
@@ -133,16 +136,14 @@
ct.setTemplate( null );
cache.remove( name );
}
-
}
}
-
File file = new File( templatepath, name );
if ( file.canRead() )
{
Template template = new Template(new BufferedInputStream(
new FileInputStream(file.getAbsolutePath())));
-
+
if ( useCache )
{
CachedTemplate cacheit = new CachedTemplate( file );