@NotThreadSafe public class FileSystemRecursiveIterator extends Object implements IIterableIterator<File>
FileHelper.getDirectoryContent(File).| Constructor and Description |
|---|
FileSystemRecursiveIterator(File aBaseDir)
Constructor for recursively iterating a file system directory.
|
FileSystemRecursiveIterator(File aBaseDir,
IPredicate<File> aRecursionFilter)
Constructor for recursively iterating a file system directory.
|
FileSystemRecursiveIterator(String sBaseDir)
Constructor for recursively iterating a file system directory.
|
FileSystemRecursiveIterator(String sBaseDir,
IPredicate<File> aRecursionFilter)
Constructor for recursively iterating a file system directory.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getLevel() |
IPredicate<File> |
getRecursionFilter() |
int |
getStartLevel() |
boolean |
hasNext() |
File |
next() |
protected boolean |
recurseIntoDirectory(File aDirectory)
Override this method to manually filter the directories, which are recursed
into.
|
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waititerator, withFilter, withMappercontainsAny, containsNone, containsOnly, findAll, findAllInstanceOf, findAllMapped, findAllMapped, findAllMapped, findFirst, findFirst, findFirstIndex, findFirstMapped, findFirstMapped, findLastIndex, forEach, forEachBreakable, forEachByIndex, getCount, getCountforEach, spliteratorforEachRemaining, removepublic FileSystemRecursiveIterator(@Nonnull String sBaseDir)
sBaseDir - The base directory to start with. May not be null.public FileSystemRecursiveIterator(@Nonnull File aBaseDir)
aBaseDir - The base directory to start with. May not be null.public FileSystemRecursiveIterator(@Nonnull String sBaseDir, @Nullable IPredicate<File> aRecursionFilter)
sBaseDir - The base directory to start with. May not be null.aRecursionFilter - An optional filter that controls, into which sub-directories this
iterator should descend to. May be null.public FileSystemRecursiveIterator(@Nonnull File aBaseDir, @Nullable IPredicate<File> aRecursionFilter)
aBaseDir - The base directory to start with. May not be null.aRecursionFilter - An optional filter that controls, into which sub-directories this
iterator should descend to. May be null.@Nonnegative public int getStartLevel()
@Nullable public IPredicate<File> getRecursionFilter()
@OverrideOnDemand protected boolean recurseIntoDirectory(@Nonnull File aDirectory)
aDirectory - The non-null directorytrue if all children of this directory should be
investigated@Nonnegative public final int getLevel()
next().
Always ≥ 0. The starting directory has level 0.Copyright © 2014–2020 Philip Helger. All rights reserved.