Package org.apache.commons.io.filefilter
Class DelegateFileFilter
java.lang.Object
org.apache.commons.io.filefilter.AbstractFileFilter
org.apache.commons.io.filefilter.DelegateFileFilter
- All Implemented Interfaces:
FileFilter
,FilenameFilter
,Serializable
,FileVisitor<Path>
,PathFilter
,PathVisitor
,IOFileFilter
This class turns a Java FileFilter or FilenameFilter into an IO FileFilter.
Deprecating Serialization
Serialization is deprecated and will be removed in 3.0.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final FileFilter
The File filterprivate final FilenameFilter
The Filename filterprivate static final long
Fields inherited from interface org.apache.commons.io.filefilter.IOFileFilter
EMPTY_STRING_ARRAY
-
Constructor Summary
ConstructorsConstructorDescriptionDelegateFileFilter
(FileFilter fileFilter) Constructs a delegate file filter around an existing FileFilter.DelegateFileFilter
(FilenameFilter filenameFilter) Constructs a delegate file filter around an existing FilenameFilter. -
Method Summary
Methods inherited from class org.apache.commons.io.filefilter.AbstractFileFilter
append, append, get, handle, postVisitDirectory, preVisitDirectory, toDefaultFileVisitResult, toFileVisitResult, visitFile, visitFileFailed
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.commons.io.filefilter.IOFileFilter
accept, and, negate, or
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
fileFilter
The File filter -
filenameFilter
The Filename filter
-
-
Constructor Details
-
DelegateFileFilter
Constructs a delegate file filter around an existing FileFilter.- Parameters:
fileFilter
- the filter to decorate
-
DelegateFileFilter
Constructs a delegate file filter around an existing FilenameFilter.- Parameters:
filenameFilter
- the filter to decorate
-
-
Method Details
-
accept
Checks the filter.- Specified by:
accept
in interfaceFileFilter
- Specified by:
accept
in interfaceIOFileFilter
- Overrides:
accept
in classAbstractFileFilter
- Parameters:
file
- the file to check- Returns:
- true if the filter matches
-
accept
Checks the filter.- Specified by:
accept
in interfaceFilenameFilter
- Specified by:
accept
in interfaceIOFileFilter
- Overrides:
accept
in classAbstractFileFilter
- Parameters:
dir
- the directoryname
- the file name in the directory- Returns:
- true if the filter matches
-
toString
Provide a String representation of this file filter.- Overrides:
toString
in classAbstractFileFilter
- Returns:
- a String representation
-