Package org.apache.commons.io.filefilter
Class AbstractFileFilter
java.lang.Object
org.apache.commons.io.filefilter.AbstractFileFilter
- All Implemented Interfaces:
- FileFilter,- FilenameFilter,- FileVisitor<Path>,- PathMatcher,- PathFilter,- PathVisitor,- IOFileFilter
- Direct Known Subclasses:
- AgeFileFilter,- AndFileFilter,- CanExecuteFileFilter,- CanReadFileFilter,- CanWriteFileFilter,- DelegateFileFilter,- DirectoryFileFilter,- EmptyFileFilter,- FileEqualsFileFilter,- FileFileFilter,- HiddenFileFilter,- MagicNumberFileFilter,- NameFileFilter,- NotFileFilter,- OrFileFilter,- PathEqualsFileFilter,- PathMatcherFileFilter,- PathVisitorFileFilter,- PrefixFileFilter,- RegexFileFilter,- SizeFileFilter,- SuffixFileFilter,- SymbolicLinkFileFilter,- WildcardFileFilter,- WildcardFilter
Abstracts the implementation of the 
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.
 
- Since:
- 1.0
- 
Field SummaryFields inherited from interface org.apache.commons.io.filefilter.IOFileFilterEMPTY_STRING_ARRAY
- 
Constructor SummaryConstructorsModifierConstructorDescriptionConstructs a new instance.protectedAbstractFileFilter(FileVisitResult onAccept, FileVisitResult onReject) Constructs a new instance.
- 
Method SummaryModifier and TypeMethodDescriptionbooleanTests to see if the File should be accepted by this filter.booleanTests to see if the File should be accepted by this filter.protected FileVisitResultHandles exceptions caught while accepting.postVisitDirectory(Path dir, IOException exc) preVisitDirectory(Path dir, BasicFileAttributes attributes) toString()Provides a String representation of this file filter.visitFile(Path file, BasicFileAttributes attributes) visitFileFailed(Path file, IOException exc) 
- 
Constructor Details- 
AbstractFileFilterpublic AbstractFileFilter()Constructs a new instance.
- 
AbstractFileFilterConstructs a new instance.- Parameters:
- onAccept- What to do on acceptance.
- onReject- What to do on rejection.
- Since:
- 2.12.0.
 
 
- 
- 
Method Details- 
acceptTests to see if the File should be accepted by this filter.- Specified by:
- acceptin interface- FileFilter
- Specified by:
- acceptin interface- IOFileFilter
- Parameters:
- file- the File to check
- Returns:
- true if this file matches the test
 
- 
acceptTests to see if the File should be accepted by this filter.- Specified by:
- acceptin interface- FilenameFilter
- Specified by:
- acceptin interface- IOFileFilter
- Parameters:
- dir- the directory File to check
- name- the file name within the directory to check
- Returns:
- true if this file matches the test
 
- 
handleHandles exceptions caught while accepting.- Parameters:
- t- the caught Throwable.
- Returns:
- the given Throwable.
- Since:
- 2.9.0
 
- 
postVisitDirectory- Specified by:
- postVisitDirectoryin interface- FileVisitor<Path>
- Throws:
- IOException
 
- 
preVisitDirectorypublic FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attributes) throws IOException - Specified by:
- preVisitDirectoryin interface- FileVisitor<Path>
- Throws:
- IOException
 
- 
toStringProvides a String representation of this file filter.
- 
visitFile- Specified by:
- visitFilein interface- FileVisitor<Path>
- Throws:
- IOException
 
- 
visitFileFailed- Specified by:
- visitFileFailedin interface- FileVisitor<Path>
- Throws:
- IOException
 
 
-