Package org.apache.commons.io.filefilter
Class NotFileFilter
- java.lang.Object
-
- org.apache.commons.io.filefilter.AbstractFileFilter
-
- org.apache.commons.io.filefilter.NotFileFilter
-
- All Implemented Interfaces:
java.io.FileFilter,java.io.FilenameFilter,java.io.Serializable,java.nio.file.FileVisitor<java.nio.file.Path>,PathFilter,PathVisitor,IOFileFilter
public class NotFileFilter extends AbstractFileFilter implements java.io.Serializable
This filter produces a logical NOT of the filters specified.Deprecating Serialization
Serialization is deprecated and will be removed in 3.0.
- Since:
- 1.0
- See Also:
FileFilterUtils.notFileFilter(IOFileFilter), Serialized Form
-
-
Field Summary
-
Fields inherited from interface org.apache.commons.io.filefilter.IOFileFilter
EMPTY_STRING_ARRAY
-
-
Constructor Summary
Constructors Constructor Description NotFileFilter(IOFileFilter filter)Constructs a new file filter that NOTs the result of another filter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaccept(java.io.File file)Returns the logical NOT of the underlying filter's return value for the same File.booleanaccept(java.io.File file, java.lang.String name)Returns the logical NOT of the underlying filter's return value for the same arguments.java.nio.file.FileVisitResultaccept(java.nio.file.Path file, java.nio.file.attribute.BasicFileAttributes attributes)Returns the logical NOT of the underlying filter's return value for the same File.java.lang.StringtoString()Provide a String representation of this file filter.-
Methods inherited from class org.apache.commons.io.filefilter.AbstractFileFilter
postVisitDirectory, preVisitDirectory, visitFile, visitFileFailed
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.commons.io.filefilter.IOFileFilter
and, negate, or
-
-
-
-
Constructor Detail
-
NotFileFilter
public NotFileFilter(IOFileFilter filter)
Constructs a new file filter that NOTs the result of another filter.- Parameters:
filter- the filter, must not be null- Throws:
java.lang.NullPointerException- if the filter is null
-
-
Method Detail
-
accept
public boolean accept(java.io.File file)
Returns the logical NOT of the underlying filter's return value for the same File.- Specified by:
acceptin interfacejava.io.FileFilter- Specified by:
acceptin interfaceIOFileFilter- Overrides:
acceptin classAbstractFileFilter- Parameters:
file- the File to check- Returns:
- true if the filter returns false
-
accept
public boolean accept(java.io.File file, java.lang.String name)Returns the logical NOT of the underlying filter's return value for the same arguments.- Specified by:
acceptin interfacejava.io.FilenameFilter- Specified by:
acceptin interfaceIOFileFilter- Overrides:
acceptin classAbstractFileFilter- Parameters:
file- the File directoryname- the file name- Returns:
- true if the filter returns false
-
accept
public java.nio.file.FileVisitResult accept(java.nio.file.Path file, java.nio.file.attribute.BasicFileAttributes attributes)Returns the logical NOT of the underlying filter's return value for the same File.- Specified by:
acceptin interfaceIOFileFilter- Specified by:
acceptin interfacePathFilter- Parameters:
file- the File to checkattributes- the file's basic attributes (TODO may be null).- Returns:
- true if the filter returns false
- Since:
- 2.9.0
-
toString
public java.lang.String toString()
Provide a String representation of this file filter.- Overrides:
toStringin classAbstractFileFilter- Returns:
- a String representation
-
-