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, waitaccept, and, negate, orstatic java.nio.file.FileVisitResult toFileVisitResult(boolean accept,
java.nio.file.Path path)
public boolean accept(java.io.File file)
accept in interface java.io.FileFilteraccept in interface IOFileFilterfile - the File to checkpublic boolean accept(java.io.File dir,
java.lang.String name)
accept in interface java.io.FilenameFilteraccept in interface IOFileFilterdir - 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.IOExceptionpublic 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.IOExceptionpublic java.lang.String toString()
toString in class java.lang.Objectpublic 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.IOExceptionpublic 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