org.apache.commons.io.filefilter

Class NotFileFilter

Implemented Interfaces:
FileFilter, FilenameFilter, IOFileFilter

public class NotFileFilter
extends AbstractFileFilter

This filter produces a logical NOT of the filters specified.
Version:
$Revision: 1.6 $ $Date: 2004/02/23 04:37:57 $
Author:
Stephen Colebourne
Since:
Commons IO 1.0

Field Summary

private IOFileFilter
filter
The filter

Constructor Summary

NotFileFilter(IOFileFilter filter)
Constructs a new file filter that NOTs the result of another filters.

Method Summary

boolean
accept(File file)
Checks to see if both filters are true.
boolean
accept(File file, String name)
Checks to see if both filters are true.

Methods inherited from class org.apache.commons.io.filefilter.AbstractFileFilter

accept, accept

Field Details

filter

private IOFileFilter filter
The filter

Constructor Details

NotFileFilter

public NotFileFilter(IOFileFilter filter)
Constructs a new file filter that NOTs the result of another filters.
Parameters:
filter - the filter, must not be null

Method Details

accept

public boolean accept(File file)
Checks to see if both filters are true.
Specified by:
accept in interface IOFileFilter
Overrides:
accept in interface AbstractFileFilter
Parameters:
file - the File to check
Returns:
true if the filter returns false

accept

public boolean accept(File file,
                      String name)
Checks to see if both filters are true.
Specified by:
accept in interface IOFileFilter
Overrides:
accept in interface AbstractFileFilter
Parameters:
file - the File directory
name - the filename
Returns:
true if the filter returns false