public class FileEqualsFileFilter extends AbstractFileFilter
File
object match. You can use this filter to visit the start directory when walking a
file tree with
Files.walkFileTree(java.nio.file.Path, java.util.Set, int, java.nio.file.FileVisitor)
.Modifier and Type | Field and Description |
---|---|
private java.io.File |
file |
private java.nio.file.Path |
path |
EMPTY_STRING_ARRAY
Constructor and Description |
---|
FileEqualsFileFilter(java.io.File file)
Constructs a new instance for the given
File . |
Modifier and Type | Method and Description |
---|---|
boolean |
accept(java.io.File file)
Checks to see if the File should be accepted by this filter.
|
java.nio.file.FileVisitResult |
accept(java.nio.file.Path path,
java.nio.file.attribute.BasicFileAttributes attributes)
Checks to see if a Path should be accepted by this filter.
|
accept, append, append, get, handle, postVisitDirectory, preVisitDirectory, toDefaultFileVisitResult, toFileVisitResult, toString, visitFile, visitFileFailed
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
and, matches, negate, or
public FileEqualsFileFilter(java.io.File file)
File
.file
- The file to match.public boolean accept(java.io.File file)
AbstractFileFilter
accept
in interface java.io.FileFilter
accept
in interface IOFileFilter
accept
in class AbstractFileFilter
file
- the File to checkpublic java.nio.file.FileVisitResult accept(java.nio.file.Path path, java.nio.file.attribute.BasicFileAttributes attributes)
IOFileFilter
path
- the Path to check.attributes
- the file's basic attributes (TODO may be null).