Class DirectoryIterator
- java.lang.Object
-
- org.codehaus.commons.compiler.util.iterator.ProducerIterator<java.io.File>
-
- org.codehaus.commons.compiler.util.iterator.DirectoryIterator
-
- All Implemented Interfaces:
java.util.Iterator<java.io.File>
public class DirectoryIterator extends ProducerIterator<java.io.File>
AnIterator<File>
that finds regular files who's names areaccepted
by the fileNameFilter and- exist in the given rootDirectory, or
-
exist in any subdirectory of the rootDirectory that is
accepted
by the directoryNameFilter.
The returned iterator will throw a
DirectoryIterator.DirectoryNotListableException
when one of the relevant directories cannot be listed.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DirectoryIterator.DirectoryNotListableException
Indicates thatFile.listFiles()
returnednull
for a particular directory.
-
Constructor Summary
Constructors Constructor Description DirectoryIterator(java.io.File rootDirectory, java.io.FilenameFilter directoryNameFilter, java.io.FilenameFilter fileNameFilter)
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.util.Iterator<java.io.File>
traverseDirectories(java.io.File[] rootDirectories, java.io.FilenameFilter directoryNameFilter, java.io.FilenameFilter fileNameFilter)
Creates anIterator
that returns all matchingFile
s locatable in a set of root directories.-
Methods inherited from class org.codehaus.commons.compiler.util.iterator.ProducerIterator
hasNext, next, remove
-
-
-
-
Method Detail
-
traverseDirectories
public static java.util.Iterator<java.io.File> traverseDirectories(java.io.File[] rootDirectories, java.io.FilenameFilter directoryNameFilter, java.io.FilenameFilter fileNameFilter)
Creates anIterator
that returns all matchingFile
s locatable in a set of root directories.
-
-