public void setMaxFilesToAdd(int maxFilesToAdd) {
        this.maxFilesToAdd = maxFilesToAdd;
    }
Maximum number of files to add.  If {@link #maxFilesToAdd} &lt; 0 (default),
then this crawler will add all documents.

@param maxFilesToAdd maximum number of files to add to the queue
tika-batch/src/main/java/org/apache/tika/batch/FileResourceCrawler.java