public abstract class AbstractFileFilter extends java.lang.Object implements IOFileFilter, PathVisitor
FileFilter
(IO), FilenameFilter
(IO), PathFilter
(NIO)
interfaces via our own IOFileFilter
interface.
Note that a subclass MUST override one of the accept
methods, otherwise that subclass will infinitely loop.
EMPTY_STRING_ARRAY
Constructor and Description |
---|
AbstractFileFilter() |
Modifier and Type | Method and Description |
---|---|
boolean |
accept(java.io.File file)
Checks to see if the File should be accepted by this filter.
|
boolean |
accept(java.io.File dir,
java.lang.String name)
Checks to see if the File should be accepted by this filter.
|
protected java.nio.file.FileVisitResult |
handle(java.lang.Throwable t)
Handles exceptions caught while accepting.
|
java.nio.file.FileVisitResult |
postVisitDirectory(java.nio.file.Path dir,
java.io.IOException exc) |
java.nio.file.FileVisitResult |
preVisitDirectory(java.nio.file.Path dir,
java.nio.file.attribute.BasicFileAttributes attributes) |
(package private) static java.nio.file.FileVisitResult |
toFileVisitResult(boolean accept,
java.nio.file.Path path) |
java.lang.String |
toString()
Provides a String representation of this file filter.
|
java.nio.file.FileVisitResult |
visitFile(java.nio.file.Path file,
java.nio.file.attribute.BasicFileAttributes attributes) |
java.nio.file.FileVisitResult |
visitFileFailed(java.nio.file.Path file,
java.io.IOException exc) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
accept, and, negate, or
static java.nio.file.FileVisitResult toFileVisitResult(boolean accept, java.nio.file.Path path)
public boolean accept(java.io.File file)
accept
in interface java.io.FileFilter
accept
in interface IOFileFilter
file
- the File to checkpublic boolean accept(java.io.File dir, java.lang.String name)
accept
in interface java.io.FilenameFilter
accept
in interface IOFileFilter
dir
- the directory File to checkname
- the file name within the directory to checkprotected java.nio.file.FileVisitResult handle(java.lang.Throwable t)
t
- the caught Throwable.public java.nio.file.FileVisitResult postVisitDirectory(java.nio.file.Path dir, java.io.IOException exc) throws java.io.IOException
postVisitDirectory
in interface java.nio.file.FileVisitor<java.nio.file.Path>
java.io.IOException
public java.nio.file.FileVisitResult preVisitDirectory(java.nio.file.Path dir, java.nio.file.attribute.BasicFileAttributes attributes) throws java.io.IOException
preVisitDirectory
in interface java.nio.file.FileVisitor<java.nio.file.Path>
java.io.IOException
public java.lang.String toString()
toString
in class java.lang.Object
public java.nio.file.FileVisitResult visitFile(java.nio.file.Path file, java.nio.file.attribute.BasicFileAttributes attributes) throws java.io.IOException
visitFile
in interface java.nio.file.FileVisitor<java.nio.file.Path>
java.io.IOException
public java.nio.file.FileVisitResult visitFileFailed(java.nio.file.Path file, java.io.IOException exc) throws java.io.IOException
visitFileFailed
in interface java.nio.file.FileVisitor<java.nio.file.Path>
java.io.IOException