org.exist.source
Class FileSource

java.lang.Object
  extended by org.exist.source.AbstractSource
      extended by org.exist.source.FileSource
All Implemented Interfaces:
Source

public class FileSource
extends AbstractSource

A source implementation reading from the file system.

Author:
wolf

Field Summary
 
Fields inherited from interface org.exist.source.Source
INVALID, UNKNOWN, VALID
 
Constructor Summary
FileSource(File file, String encoding, boolean checkXQEncoding)
           
 
Method Summary
 String getContent()
           
 File getFile()
           
 String getFilePath()
           
 InputStream getInputStream()
           
 Object getKey()
          Returns a unique key to identify the source, usually an URI.
 Reader getReader()
          Returns a Reader to read the contents of the source.
 int isValid(DBBroker broker)
          Is this source object still valid? Returns Source.UNKNOWN if the validity of the source cannot be determined.
 int isValid(Source other)
          Checks if the source object is still valid by comparing it to another version of the same source.
 String toString()
           
 
Methods inherited from class org.exist.source.AbstractSource
equals, getCacheTimestamp, hashCode, setCacheTimestamp
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FileSource

public FileSource(File file,
                  String encoding,
                  boolean checkXQEncoding)
Method Detail

getKey

public Object getKey()
Description copied from interface: Source
Returns a unique key to identify the source, usually an URI.


getFilePath

public String getFilePath()

getFile

public File getFile()

isValid

public int isValid(DBBroker broker)
Description copied from interface: Source
Is this source object still valid? Returns Source.UNKNOWN if the validity of the source cannot be determined. The DBBroker parameter is required by some implementations as they have to read resources from the database.


isValid

public int isValid(Source other)
Description copied from interface: Source
Checks if the source object is still valid by comparing it to another version of the same source. It depends on the concrete implementation how the sources are compared. Use this method if Source.isValid(DBBroker) return Source.UNKNOWN.


getReader

public Reader getReader()
                 throws IOException
Description copied from interface: Source
Returns a Reader to read the contents of the source.

Throws:
IOException

getInputStream

public InputStream getInputStream()
                           throws IOException
Throws:
IOException

getContent

public String getContent()
                  throws IOException
Throws:
IOException

toString

public String toString()
Overrides:
toString in class Object


Copyright (C) Wolfgang Meier. All rights reserved.