FileDocCategorySizeDatePackage
NotFileFilter.javaAPI DocAndroid 1.5 API2531Wed May 06 22:42:46 BST 2009org.apache.commons.io.filefilter

NotFileFilter

public class NotFileFilter extends AbstractFileFilter implements Serializable
This filter produces a logical NOT of the filters specified.
since
Commons IO 1.0
version
$Revision: 591058 $ $Date: 2007-11-01 15:47:05 +0000 (Thu, 01 Nov 2007) $
author
Stephen Colebourne

Fields Summary
private final IOFileFilter
filter
The filter
Constructors Summary
public NotFileFilter(IOFileFilter filter)
Constructs a new file filter that NOTs the result of another filters.

param
filter the filter, must not be null
throws
IllegalArgumentException if the filter is null

        if (filter == null) {
            throw new IllegalArgumentException("The filter must not be null");
        }
        this.filter = filter;
    
Methods Summary
public booleanaccept(java.io.File file)
Checks to see if both filters are true.

param
file the File to check
return
true if the filter returns false

        return ! filter.accept(file);
    
public booleanaccept(java.io.File file, java.lang.String name)
Checks to see if both filters are true.

param
file the File directory
param
name the filename
return
true if the filter returns false

        return ! filter.accept(file, name);
    
public java.lang.StringtoString()
Provide a String representaion of this file filter.

return
a String representaion

        return super.toString() + "(" + filter.toString()  + ")";