public abstract class SmartLinksDirectoryWalker
extends org.apache.commons.io.DirectoryWalker
DirectoryWalker which provides convenience methods to
initiate traversal, and (optionally) does not follow symbolic
links.| Modifier | Constructor and Description |
|---|---|
protected |
SmartLinksDirectoryWalker(boolean followLinks)
Constructor mirroring superclass constructor.
|
protected |
SmartLinksDirectoryWalker(boolean followLinks,
FileFilter filter,
int depthLimit)
Constructor mirroring superclass constructor.
|
protected |
SmartLinksDirectoryWalker(boolean followLinks,
org.apache.commons.io.filefilter.IOFileFilter directoryFilter,
org.apache.commons.io.filefilter.IOFileFilter fileFilter,
int depthLimit)
Constructor mirroring superclass constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
apply(File root)
Traverses the file tree rooted at the given root.
|
void |
apply(File root,
Collection results)
Traverses the file tree rooted at the given root.
|
void |
apply(String name)
Traverses the file tree rooted at the file with the given
name.
|
void |
apply(String name,
Collection results)
Traverses the file tree rooted at the file with the given
name.
|
boolean |
getFollowLinks()
Returns true if symbolic links to directories should be
followed during traversal.
|
protected boolean |
handleDirectory(File directory,
int depth,
Collection results)
Returns false if the given directory is a symbolic link to a
directory, and links are not to be followed, thereby blocking
following the link during traversal.
|
protected SmartLinksDirectoryWalker(boolean followLinks)
followLinks - True if links should be followed.DirectoryWalker.DirectoryWalker()protected SmartLinksDirectoryWalker(boolean followLinks,
FileFilter filter,
int depthLimit)
followLinks - True if links should be followed.filter - The filter to apply. It may be null, meaning
visit all files.depthLimit - Controls to what depth the hierarchy is
navigated. Less than 0 means unlimited.DirectoryWalker.DirectoryWalker(FileFilter,int)protected SmartLinksDirectoryWalker(boolean followLinks,
org.apache.commons.io.filefilter.IOFileFilter directoryFilter,
org.apache.commons.io.filefilter.IOFileFilter fileFilter,
int depthLimit)
followLinks - True if links should be followed.directoryFilter - The filter to apply to directories. It
may be null, meaning visit all directories.fileFilter - The filter to apply to files. It may be null,
meaning visit all directories.depthLimit - Controls to what depth the hierarchy is
navigated. Less than 0 means unlimited.DirectoryWalker.DirectoryWalker(IOFileFilter,IOFileFilter,int)protected boolean handleDirectory(File directory, int depth, Collection results) throws IOException
DirectoryWalker.handleFile(File,int,Collection)
on the link.handleDirectory in class org.apache.commons.io.DirectoryWalkerIOExceptionDirectoryWalker.handleDirectory(File,int,Collection)public boolean getFollowLinks()
public void apply(File root, Collection results) throws IOException
root - The root.results - An object passed intact into DirectoryWalker callbacks.IOException - Thrown if an I/O error occurs.public void apply(File root) throws IOException
results argument in all DirectoryWalker callbacks will be null.root - The root.IOException - Thrown if an I/O error occurs.public void apply(String name, Collection results) throws IOException
name - The file name.results - An object passed intact into DirectoryWalker callbacks.IOException - Thrown if an I/O error occurs.public void apply(String name) throws IOException
results
argument in all DirectoryWalker callbacks will be null.name - The file name.IOException - Thrown if an I/O error occurs.Copyright © 2015. All Rights Reserved.