public abstract class FileVisitor extends Object
DirScanner
Constructor and Description |
---|
FileVisitor() |
Modifier and Type | Method and Description |
---|---|
boolean |
understandsSymlink()
Some visitors can handle symlinks as symlinks.
|
abstract void |
visit(File f,
String relativePath)
Called for each file and directory that matches the criteria implied by
DirScanner |
void |
visitSymlink(File link,
String target,
String relativePath)
Some visitors can handle symlinks as symlinks.
|
FileVisitor |
with(FileFilter f)
Decorates a visitor by a given filter.
|
public abstract void visit(File f, String relativePath) throws IOException
DirScanner
f
- Either a file or a directory.relativePath
- The file/directory name in questionIOException
public void visitSymlink(File link, String target, String relativePath) throws IOException
This method is invoked by those DirScanner
s that can handle symlinks as symlinks.
(Not every DirScanner
s are capable of doing that, as proper symlink handling requires
letting visitors decide whether or not to descend into a symlink directory.)
IOException
public boolean understandsSymlink()
visitSymlink(File, String, String)
.
Note that failures to detect or read symlinks on certain platforms
can cause visit(java.io.File, java.lang.String)
to be called on a file which is actually a symlink.public final FileVisitor with(FileFilter f)
Copyright © 2016. All rights reserved.