public class FilesInDirectoryCollectionReader
extends CollectionReader_ImplBase
Modifier and Type | Field and Description |
---|---|
protected int |
iv_currentIndex |
private java.lang.String |
iv_encoding |
private static java.lang.String[] |
iv_extensions |
protected java.util.ArrayList<java.io.File> |
iv_files |
private java.lang.String |
iv_language |
private boolean |
iv_recurse |
private java.lang.String |
iv_rootPath |
static java.lang.String |
PARAM_ENCODING
Name of configuration parameter that contains the character encoding used
by the input files.
|
static java.lang.String |
PARAM_EXTENSIONS
Name of optional configuration parameter that specifies the extensions
of the files that the collection reader will read.
|
static java.lang.String |
PARAM_INPUTDIR
Name of configuration parameter that must be set to the path of
a directory containing input files.
|
static java.lang.String |
PARAM_LANGUAGE
Name of optional configuration parameter that contains the language of
the documents in the input directory.
|
static java.lang.String |
PARAM_RECURSE |
Constructor and Description |
---|
FilesInDirectoryCollectionReader() |
Modifier and Type | Method and Description |
---|---|
void |
close() |
private void |
collectFiles(java.io.File directory,
java.util.List<java.io.File> files) |
private java.lang.String |
createDocID(java.io.File file) |
void |
getNext(CAS aCAS) |
int |
getNumberOfDocuments()
Gets the total number of documents that will be returned by this
collection reader.
|
Progress[] |
getProgress() |
boolean |
hasNext() |
private boolean |
hasValidExtension(java.io.File file) |
void |
initialize() |
public static final java.lang.String PARAM_INPUTDIR
public static final java.lang.String PARAM_ENCODING
public static final java.lang.String PARAM_LANGUAGE
public static final java.lang.String PARAM_EXTENSIONS
'.'
.public static final java.lang.String PARAM_RECURSE
protected java.util.ArrayList<java.io.File> iv_files
private java.lang.String iv_encoding
private java.lang.String iv_language
private static java.lang.String[] iv_extensions
protected int iv_currentIndex
private boolean iv_recurse
private java.lang.String iv_rootPath
public void initialize() throws ResourceInitializationException
ResourceInitializationException
org.apache.uima.collection.CollectionReader_ImplBase#initialize()
private void collectFiles(java.io.File directory, java.util.List<java.io.File> files) throws java.io.IOException
java.io.IOException
private boolean hasValidExtension(java.io.File file)
public boolean hasNext()
org.apache.uima.collection.CollectionReader#hasNext()
public void getNext(CAS aCAS) throws java.io.IOException, CollectionException
java.io.IOException
CollectionException
org.apache.uima.collection.CollectionReader#getNext(org.apache.uima.cas.CAS)
private java.lang.String createDocID(java.io.File file)
public void close() throws java.io.IOException
java.io.IOException
org.apache.uima.collection.base_cpm.BaseCollectionReader#close()
public Progress[] getProgress()
org.apache.uima.collection.base_cpm.BaseCollectionReader#getProgress()
public int getNumberOfDocuments()