upidiff.input
Class FileInputSource

java.lang.Object
  |
  +--upidiff.input.FileInputSource
All Implemented Interfaces:
InputSource

public final class FileInputSource
extends Object
implements InputSource

A generic interface to data sources in a systems filesystem.

Author:
bmeurer, kasbar

Field Summary
private  File file
          The input file.
private  BufferedReader reader
          Buffered reader object connected with the input file.
 
Constructor Summary
FileInputSource(File file)
          Creates a new data source associated with a local file.
 
Method Summary
 String name()
          Returns the absolute path of the input file.
 String readLine()
          Reads one line from the input file.
 String url()
          Returns the URL for this input file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

reader

private BufferedReader reader
Buffered reader object connected with the input file.


file

private File file
The input file.

Constructor Detail

FileInputSource

public FileInputSource(File file)
                throws InputException
Creates a new data source associated with a local file.

Parameters:
file - Input file.
Throws:
InputException - The file could not be opened for reading.
Method Detail

name

public String name()
Returns the absolute path of the input file.

Specified by:
name in interface InputSource
Returns:
The absolute path for the input file.

url

public String url()
Returns the URL for this input file.

Specified by:
url in interface InputSource
Returns:
The URL for this inpue file.

readLine

public String readLine()
                throws InputException
Reads one line from the input file.

Specified by:
readLine in interface InputSource
Returns:
The line read or null at end of file.
Throws:
InputException - The process fails to read from the file.