public class FSDirectoryCrawler extends FileResourceCrawler
| Modifier and Type | Class and Description |
|---|---|
static class |
FSDirectoryCrawler.CRAWL_ORDER |
private class |
FSDirectoryCrawler.FileNameComparator |
| Modifier and Type | Field and Description |
|---|---|
private FSDirectoryCrawler.CRAWL_ORDER |
crawlOrder |
private java.util.Comparator<java.nio.file.Path> |
pathComparator |
private java.nio.file.Path |
root |
private java.nio.file.Path |
startDirectory |
ADDED, LOG, SKIPPED, STOP_NOW| Constructor and Description |
|---|
FSDirectoryCrawler(java.util.concurrent.ArrayBlockingQueue<FileResource> fileQueue,
int numConsumers,
java.nio.file.Path root,
FSDirectoryCrawler.CRAWL_ORDER crawlOrder) |
FSDirectoryCrawler(java.util.concurrent.ArrayBlockingQueue<FileResource> fileQueue,
int numConsumers,
java.nio.file.Path root,
java.nio.file.Path startDirectory,
FSDirectoryCrawler.CRAWL_ORDER crawlOrder) |
| Modifier and Type | Method and Description |
|---|---|
private void |
addFiles(java.nio.file.Path directory) |
void |
handleFirstFileInDirectory(java.nio.file.Path f)
Override this if you have any special handling
for the first actual file that the crawler comes across
in a directory.
|
void |
start()
Implement this to control the addition of FileResources.
|
call, getAdded, getConsidered, isActive, isQueueEmpty, select, setDocumentSelector, setMaxConsecWaitInMillis, setMaxFilesToAdd, setMaxFilesToConsider, shutDownNoPoison, tryToAdd, wasTimedOutprivate final java.nio.file.Path root
private final java.nio.file.Path startDirectory
private final java.util.Comparator<java.nio.file.Path> pathComparator
private FSDirectoryCrawler.CRAWL_ORDER crawlOrder
public FSDirectoryCrawler(java.util.concurrent.ArrayBlockingQueue<FileResource> fileQueue, int numConsumers, java.nio.file.Path root, FSDirectoryCrawler.CRAWL_ORDER crawlOrder)
public FSDirectoryCrawler(java.util.concurrent.ArrayBlockingQueue<FileResource> fileQueue, int numConsumers, java.nio.file.Path root, java.nio.file.Path startDirectory, FSDirectoryCrawler.CRAWL_ORDER crawlOrder)
public void start()
throws java.lang.InterruptedException
FileResourceCrawlerFileResourceCrawler.tryToAdd(org.apache.tika.batch.FileResource)
to add FileResources to the queue.start in class FileResourceCrawlerjava.lang.InterruptedExceptionprivate void addFiles(java.nio.file.Path directory)
throws java.lang.InterruptedException
java.lang.InterruptedExceptionpublic void handleFirstFileInDirectory(java.nio.file.Path f)
f - file to handle