public class FileRecordReader extends Object implements RecordReader
RecordReader that recursively reads files in a directory.
This reader produces FileRecord instances.| Constructor and Description |
|---|
FileRecordReader(File directory)
Create a
FileRecordReader to read files recursively from a given directory. |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the reader.
|
String |
getDataSourceName()
This method returns a human readable data source name to be shown in the batch report.
|
Long |
getTotalRecords()
Get the total record number in the data source.
|
boolean |
hasNextRecord()
Check if the directory has a next file.
|
void |
open()
Open the reader.
|
FileRecord |
readNextRecord()
Read next record from the data source.
|
public FileRecordReader(File directory)
FileRecordReader to read files recursively from a given directory.directory - the directory to read files from.public void open()
open in interface RecordReaderpublic boolean hasNextRecord()
hasNextRecord in interface RecordReaderpublic FileRecord readNextRecord()
readNextRecord in interface RecordReaderpublic Long getTotalRecords()
getTotalRecords in interface RecordReaderpublic String getDataSourceName()
getDataSourceName in interface RecordReaderpublic void close()
close in interface RecordReaderCopyright © 2015. All Rights Reserved.