EchoPoint
1.0

echopoint.template
Class FileDataSource

java.lang.Object
  extended byechopoint.template.AbstractDataSource
      extended byechopoint.template.FileDataSource
All Implemented Interfaces:
DataSource, java.io.Serializable
Direct Known Subclasses:
CachedFileDataSource

public class FileDataSource
extends AbstractDataSource

A FileDataSource implements a DataSource for a file.

See Also:
Serialized Form

Field Summary
protected  java.lang.String canonicalName
           
 
Fields inherited from class echopoint.template.AbstractDataSource
DEFAULT_ENCODING
 
Constructor Summary
FileDataSource(java.io.File f)
          Constructs a FileDataSource with the specified file
FileDataSource(java.io.File f, java.lang.String encoding)
          Constructs a FileDataSource with the specified file
 
Method Summary
 java.lang.String getCanonicalName()
          Returns a canonical name of this DataSource.
 java.io.Reader getInputReader()
          Gets an Reader of the File.
 long lastModified()
          Returns the time the content of this File was last modified.
 
Methods inherited from class echopoint.template.AbstractDataSource
getCharacterEncoding, setCharacterEncoding
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

canonicalName

protected java.lang.String canonicalName
Constructor Detail

FileDataSource

public FileDataSource(java.io.File f)
Constructs a FileDataSource with the specified file

Parameters:
f - - the File to read the data from Uses the default character encoding of AbstractDataSource.DEFAULT_ENCODING

FileDataSource

public FileDataSource(java.io.File f,
                      java.lang.String encoding)
Constructs a FileDataSource with the specified file

Parameters:
f - - the File to read the data from
encoding - - the character encoding to use
Method Detail

getCanonicalName

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

Specified by:
getCanonicalName in interface DataSource
Specified by:
getCanonicalName in class AbstractDataSource

getInputReader

public java.io.Reader getInputReader()
                              throws java.io.IOException
Gets an Reader of the File.

Specified by:
getInputReader in interface DataSource
Specified by:
getInputReader in class AbstractDataSource
Throws:
java.io.IOException

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 DataSource
Specified by:
lastModified in class AbstractDataSource
Returns:
long a modification time

EchoPoint
1.0