@NotThreadSafe public class FileSystemRecursiveIterator extends Object implements IIterableIterator<File>
FileUtils.getDirectoryContent(File).| Constructor and Description |
|---|
FileSystemRecursiveIterator(File aBaseDir)
Constructor for recursively iterating a file system directory.
|
FileSystemRecursiveIterator(File aBaseDir,
AbstractFileFilter aRecursionFilter)
Constructor for recursively iterating a file system directory.
|
FileSystemRecursiveIterator(File aBaseDir,
FileFilter aRecursionFilter)
Constructor for recursively iterating a file system directory.
|
FileSystemRecursiveIterator(File aBaseDir,
FilenameFilter aRecursionFilter)
Constructor for recursively iterating a file system directory.
|
FileSystemRecursiveIterator(File aBaseDir,
IFilter<File> aRecursionFilter)
Constructor for recursively iterating a file system directory.
|
FileSystemRecursiveIterator(String sBaseDir)
Constructor for recursively iterating a file system directory.
|
FileSystemRecursiveIterator(String sBaseDir,
AbstractFileFilter aRecursionFilter)
Constructor for recursively iterating a file system directory.
|
FileSystemRecursiveIterator(String sBaseDir,
FileFilter aRecursionFilter)
Constructor for recursively iterating a file system directory.
|
FileSystemRecursiveIterator(String sBaseDir,
FilenameFilter aRecursionFilter)
Constructor for recursively iterating a file system directory.
|
FileSystemRecursiveIterator(String sBaseDir,
IFilter<File> aRecursionFilter)
Constructor for recursively iterating a file system directory.
|
| Modifier and Type | Method and Description |
|---|---|
static IIterableIterator<File> |
create(File fBaseDir,
FileFilter... aFileFilters)
Create a new iterator that recursively descends into sub-directories
starting from the given base directory.
|
static IIterableIterator<File> |
create(File fBaseDir,
FileFilter aFileFilter)
Create a new iterator that recursively descends into sub-directories
starting from the given base directory.
|
static IIterableIterator<File> |
create(File fBaseDir,
FilenameFilter... aFilenameFilters)
Create a new iterator that recursively descends into sub-directories
starting from the given base directory.
|
static IIterableIterator<File> |
create(File fBaseDir,
FilenameFilter aFilenameFilter)
Create a new iterator that recursively descends into sub-directories
starting from the given base directory.
|
static IIterableIterator<File> |
create(String sBaseDir,
FileFilter... aFileFilters)
Create a new iterator that recursively descends into sub-directories
starting from the given base directory.
|
static IIterableIterator<File> |
create(String sBaseDir,
FileFilter aFileFilter)
Create a new iterator that recursively descends into sub-directories
starting from the given base directory.
|
static IIterableIterator<File> |
create(String sBaseDir,
FilenameFilter... aFilenameFilters)
Create a new iterator that recursively descends into sub-directories
starting from the given base directory.
|
static IIterableIterator<File> |
create(String sBaseDir,
FilenameFilter aFilenameFilter)
Create a new iterator that recursively descends into sub-directories
starting from the given base directory.
|
int |
getLevel() |
boolean |
hasNext() |
Iterator<File> |
iterator() |
File |
next() |
protected boolean |
recurseIntoDirectory(File aDirectory)
Override this method to manually filter the directories, which are recursed
into.
|
void |
remove() |
String |
toString() |
public 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 FilenameFilter 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 String sBaseDir, @Nullable FileFilter 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 String sBaseDir, @Nullable AbstractFileFilter 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 String sBaseDir, @Nullable IFilter<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 FilenameFilter 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.public FileSystemRecursiveIterator(@Nonnull File aBaseDir, @Nullable FileFilter 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.public FileSystemRecursiveIterator(@Nonnull File aBaseDir, @Nullable AbstractFileFilter 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.public FileSystemRecursiveIterator(@Nonnull File aBaseDir, @Nullable IFilter<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.@OverrideOnDemand protected boolean recurseIntoDirectory(@Nonnull File aDirectory)
aDirectory - The non-null directorytrue if all children of this directory should be
investigated@Nonnull public final File next()
IIterableIterator@Nonnegative public final int getLevel()
next().
Always ≥ 0. The starting directory has level 0.@UnsupportedOperation public final void remove()
@Nonnull public static IIterableIterator<File> create(@Nonnull String sBaseDir, @Nonnull FilenameFilter aFilenameFilter)
FilenameFilter can be added, that determines, which results to be
returned and which not. The difference between the filter passed here and
the filter that can be specified in the constructor is the following: the
IFilter in the constructor defines into which sub-directories to
descend. The FilenameFilter passed to this method only defines
which elements should be returned and which not, independent of the
iterated files (like a "view").sBaseDir - The base directory to start iterating. May not be null.aFilenameFilter - The file filter to be used. May not be null.null.@Nonnull public static IIterableIterator<File> create(@Nonnull File fBaseDir, @Nonnull FilenameFilter aFilenameFilter)
FilenameFilter can be added, that determines, which results to be
returned and which not. The difference between the filter passed here and
the filter that can be specified in the constructor is the following: the
IFilter in the constructor defines into which sub-directories to
descend. The FilenameFilter passed to this method only defines
which elements should be returned and which not, independent of the
iterated files (like a "view").fBaseDir - The base directory to start iterating. May not be null.aFilenameFilter - The file filter to be used. May not be null.null.@Nonnull public static IIterableIterator<File> create(@Nonnull String sBaseDir, @Nonnull@Nonempty FilenameFilter... aFilenameFilters)
FilenameFilters can be added, that determine, which results to be
returned and which not. The difference between the filter passed here and
the filter that can be specified in the constructor is the following: the
IFilter in the constructor defines into which sub-directories to
descend. The FilenameFilters passed to this method only define
which elements should be returned and which not, independent of the
iterated files (like a "view").sBaseDir - The base directory to start iterating. May not be null.aFilenameFilters - The file filter to be used. May neither be null nor
empty.null.@Nonnull public static IIterableIterator<File> create(@Nonnull File fBaseDir, @Nonnull@Nonempty FilenameFilter... aFilenameFilters)
FilenameFilters can be added, that determine, which results to be
returned and which not. The difference between the filter passed here and
the filter that can be specified in the constructor is the following: the
IFilter in the constructor defines into which sub-directories to
descend. The FilenameFilters passed to this method only define
which elements should be returned and which not, independent of the
iterated files (like a "view").fBaseDir - The base directory to start iterating. May not be null.aFilenameFilters - The file filter to be used. May neither be null nor
empty.null.@Nonnull public static IIterableIterator<File> create(@Nonnull String sBaseDir, @Nonnull FileFilter aFileFilter)
FileFilter
can be added, that determines, which results to be returned and which not.
The difference between the filter passed here and the filter that can be
specified in the constructor is the following: the IFilter in the
constructor defines into which sub-directories to descend. The
FileFilter passed to this method only defines which elements should
be returned and which not, independent of the iterated files (like a
"view").sBaseDir - The base directory to start iterating. May not be null.aFileFilter - The file filter to be used. May not be null.null.@Nonnull public static IIterableIterator<File> create(@Nonnull File fBaseDir, @Nonnull FileFilter aFileFilter)
FileFilter
can be added, that determines, which results to be returned and which not.
The difference between the filter passed here and the filter that can be
specified in the constructor is the following: the IFilter in the
constructor defines into which sub-directories to descend. The
FileFilter passed to this method only defines which elements should
be returned and which not, independent of the iterated files (like a
"view").fBaseDir - The base directory to start iterating. May not be null.aFileFilter - The file filter to be used. May not be null.null.@Nonnull public static IIterableIterator<File> create(@Nonnull String sBaseDir, @Nonnull@Nonempty FileFilter... aFileFilters)
FileFilters can be added, that determine, which results to be
returned and which not. The difference between the filter passed here and
the filter that can be specified in the constructor is the following: the
IFilter in the constructor defines into which sub-directories to
descend. The FileFilters passed to this method only define which
elements should be returned and which not, independent of the iterated
files (like a "view").sBaseDir - The base directory to start iterating. May not be null.aFileFilters - The file filter to be used. May neither be null nor
empty.null.@Nonnull public static IIterableIterator<File> create(@Nonnull File fBaseDir, @Nonnull@Nonempty FileFilter... aFileFilters)
FileFilters can be added, that determine, which results to be
returned and which not. The difference between the filter passed here and
the filter that can be specified in the constructor is the following: the
IFilter in the constructor defines into which sub-directories to
descend. The FileFilters passed to this method only define which
elements should be returned and which not, independent of the iterated
files (like a "view").fBaseDir - The base directory to start iterating. May not be null.aFileFilters - The file filter to be used. May neither be null nor
empty.null.Copyright © 2006–2014 phloc systems. All rights reserved.