public abstract class ReadFile
extends java.lang.Object
Constructor and Description |
---|
ReadFile(java.io.File inputSource)
Constructor expecting the path to a file or a directory.
|
Modifier and Type | Method and Description |
---|---|
int |
countLines() |
void |
execute()
Read every file and pass every line of it to the lineReceiver.
|
java.io.File |
getInput()
Return the original input.
|
abstract void |
lineReceiver(java.io.File file,
int lineNumber,
java.lang.String token)
Is called by the execute method for each line that is read.
|
public ReadFile(java.io.File inputSource)
inputSource
- (File) File or directory.public abstract void lineReceiver(java.io.File file, int lineNumber, java.lang.String token) throws java.lang.Exception
file
- (File) The input file that is currently read.lineNumber
- (int) Linenumber in the currently read file.token
- (String) A line of text.java.lang.Exception
- General exception for use in this methods implementation.public final void execute() throws java.lang.Exception
java.lang.Exception
- Is thrown when the receiving lineReceiver method encounters an exception.public int countLines() throws java.io.IOException
java.io.IOException
public final java.io.File getInput()