public abstract class AbstractDirectoryReader<T> extends AbstractReader<T> implements Iterator<T>
| Constructor and Description |
|---|
AbstractDirectoryReader()
Construct a new AbstractDirectoryReader.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the reader.
|
protected abstract Reader<T> |
createReader(org.springframework.core.io.Resource file)
Create a new
Reader to read the file. |
List<String> |
getBaseFileNames()
Get the list of base file names to read.
|
File |
getDirectory()
Get the directory containing the files to read.
|
FilenameFilter |
getFileNameFilter()
Get the filter used to select files from the directory.
|
protected List<File> |
getFiles()
Get the files that are to be read by this reader.
|
boolean |
hasNext()
Check to see if the reader has more data objects to be read.
|
Iterator<T> |
iterator()
Get the iterator.
|
T |
next()
Get the next data object read by this reader.
|
void |
open()
Open the reader so that it is ready to be read from.
|
void |
remove()
Removing data objects is not supported.
|
void |
setBaseFileNames(Collection<String> baseFileNames)
Set the list of base file names to read.
|
void |
setDirectory(File directory)
Set the directory containing the files to read.
|
void |
setFileExtensions(Collection<String> fileExtensions) |
void |
setFileExtensions(String... fileExtensions) |
void |
setFileNameFilter(FilenameFilter fileNameFilter)
Set the filter used to select files from the directory.
|
read, visitclearProperties, getProperties, getProperty, getProperty, removeProperty, setProperties, setProperty, setPropertySoft, setPropertyWeakclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclearProperties, getProperties, getProperty, getProperty, removeProperty, setProperties, setProperty, setPropertySoft, setPropertyWeakpublic AbstractDirectoryReader()
public void close()
close in interface Reader<T>close in interface AutoCloseableclose in class AbstractObjectWithPropertiesprotected abstract Reader<T> createReader(org.springframework.core.io.Resource file)
Reader to read the file.file - The file to read.public List<String> getBaseFileNames()
public File getDirectory()
public FilenameFilter getFileNameFilter()
protected List<File> getFiles()
#createReader(File).public boolean hasNext()
public T next()
next in interface Iterator<T>NoSuchElementException - If the reader has no more data objects.@PostConstruct public void open()
Readerpublic void remove()
public void setBaseFileNames(Collection<String> baseFileNames)
baseFileNames - The list of base file names to read.public void setDirectory(File directory)
directory - The directory containing the files to read.public void setFileExtensions(Collection<String> fileExtensions)
public void setFileExtensions(String... fileExtensions)
public void setFileNameFilter(FilenameFilter fileNameFilter)
fileNameFilter - The filter used to select files from the directory.Copyright © 2015 Revolution Systems Inc.. All rights reserved.