|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.commons.io.DirectoryWalker
org.marketcetera.util.file.SmartLinksDirectoryWalker
public abstract class SmartLinksDirectoryWalker
A DirectoryWalker which provides convenience methods to
initiate traversal, and (optionally) does not follow symbolic
links.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.apache.commons.io.DirectoryWalker |
|---|
DirectoryWalker.CancelException |
| Constructor Summary | |
|---|---|
protected |
SmartLinksDirectoryWalker(boolean followLinks)
Constructor mirroring superclass constructor. |
protected |
SmartLinksDirectoryWalker(boolean followLinks,
FileFilter filter,
int depthLimit)
Constructor mirroring superclass constructor. |
protected |
SmartLinksDirectoryWalker(boolean followLinks,
IOFileFilter directoryFilter,
IOFileFilter fileFilter,
int depthLimit)
Constructor mirroring superclass constructor. |
| Method Summary | |
|---|---|
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. |
| Methods inherited from class org.apache.commons.io.DirectoryWalker |
|---|
checkIfCancelled, handleCancelled, handleDirectoryEnd, handleDirectoryStart, handleEnd, handleFile, handleIsCancelled, handleRestricted, handleStart, walk |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
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,
IOFileFilter directoryFilter,
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)| Method Detail |
|---|
protected boolean handleDirectory(File directory,
int depth,
Collection results)
throws IOException
DirectoryWalker.handleFile(File,int,Collection)
on the link.
handleDirectory in class 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.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||