org.apache.commons.io.filefilter

Class NotFileFilter

Implemented Interfaces:
FileFilter, FilenameFilter, Serializable, IOFileFilter

public class NotFileFilter
extends AbstractFileFilter
implements Serializable

This filter produces a logical NOT of the filters specified.
Version:
$Revision: 591058 $ $Date: 2007-11-01 15:47:05 +0000 (Thu, 01 Nov 2007) $
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.
String
toString()
Provide a String representaion of this file filter.

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

accept, accept, toString

Field Details

filter

private final 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

toString

public String toString()
Provide a String representaion of this file filter.
Overrides:
toString in interface AbstractFileFilter
Returns:
a String representaion

Copyright (c) 2002-2009 Apache Software Foundation