freemarker.template
Class FileInputSource

java.lang.Object
  extended by freemarker.template.InputSource
      extended by freemarker.template.FileInputSource

public class FileInputSource
extends InputSource

Provides a file to be compiled into a FM-Classic template.

Since:
1.9
Version:
$Id: FileInputSource.java 1154 2005-10-09 09:22:01Z run2000 $

Field Summary
 
Fields inherited from class freemarker.template.InputSource
encoding, reader, stream
 
Constructor Summary
FileInputSource()
          Create an empty FileInputSource.
FileInputSource(java.io.File file)
          Create a FileInputSource with the supplied File.
FileInputSource(java.io.File file, java.lang.String encoding)
          Create a FileInputSource with the supplied File and character encoding.
FileInputSource(java.lang.String filename)
          Create a FileInputSource with the supplied filename.
FileInputSource(java.lang.String filename, java.lang.String encoding)
          Create a FileInputSource with the supplied filename and character encoding.
 
Method Summary
 void setFile(java.io.File file)
          Set the File to be provided by this FileInputSource.
 void setFile(java.io.File file, java.lang.String encoding)
          Set the File to be provided by this FileInputSource.
 void setFilename(java.lang.String filename)
          Set the filename of the file to be provided by this FileInputSource.
 void setFilename(java.lang.String filename, java.lang.String encoding)
          Set the filename of the file to be provided by this FileInputSource.
 
Methods inherited from class freemarker.template.InputSource
getEncoding, getInputStream, getReader, setEncoding, setInputStream, setReader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileInputSource

public FileInputSource()
Create an empty FileInputSource.


FileInputSource

public FileInputSource(java.io.File file)
                throws java.io.FileNotFoundException
Create a FileInputSource with the supplied File.

Parameters:
file - the file to be provided by this input source
Throws:
java.io.FileNotFoundException - the file could not be found

FileInputSource

public FileInputSource(java.io.File file,
                       java.lang.String encoding)
                throws java.io.FileNotFoundException
Create a FileInputSource with the supplied File and character encoding.

Parameters:
file - the file to be provided by this input source
encoding - the character encoding for the given file
Throws:
java.io.FileNotFoundException - the file could not be found

FileInputSource

public FileInputSource(java.lang.String filename)
                throws java.io.FileNotFoundException
Create a FileInputSource with the supplied filename.

Parameters:
filename - the file to be provided by this input source
Throws:
java.io.FileNotFoundException - the file could not be found

FileInputSource

public FileInputSource(java.lang.String filename,
                       java.lang.String encoding)
                throws java.io.FileNotFoundException
Create a FileInputSource with the supplied filename and character encoding.

Parameters:
filename - the file to be provided by this input source
encoding - the character encoding for the given file
Throws:
java.io.FileNotFoundException - the file could not be found
Method Detail

setFile

public void setFile(java.io.File file)
             throws java.io.FileNotFoundException
Set the File to be provided by this FileInputSource.

Parameters:
file - the file for this FileInputSource
Throws:
java.io.FileNotFoundException - the file could not be found

setFile

public void setFile(java.io.File file,
                    java.lang.String encoding)
             throws java.io.FileNotFoundException
Set the File to be provided by this FileInputSource.

Parameters:
file - the file for this FileInputSource
encoding - the character encoding for this file
Throws:
java.io.FileNotFoundException - the file could not be found

setFilename

public void setFilename(java.lang.String filename)
                 throws java.io.FileNotFoundException
Set the filename of the file to be provided by this FileInputSource.

Parameters:
filename - the file for this FileInputSource
Throws:
java.io.FileNotFoundException - the file could not be found

setFilename

public void setFilename(java.lang.String filename,
                        java.lang.String encoding)
                 throws java.io.FileNotFoundException
Set the filename of the file to be provided by this FileInputSource.

Parameters:
filename - the file for this FileInputSource
encoding - the character encoding for this file
Throws:
java.io.FileNotFoundException - the file could not be found