org.apache.commons.io.filefilter
Class NotFileFilter

java.lang.Object
  extended byorg.apache.commons.io.filefilter.AbstractFileFilter
      extended byorg.apache.commons.io.filefilter.NotFileFilter
All Implemented Interfaces:
FileFilter, FilenameFilter, IOFileFilter

public class NotFileFilter
extends AbstractFileFilter

This filter produces a logical NOT of the filters specified.

Since:
Commons IO 1.0
Version:
$Revision: 155419 $ $Date: 2005-02-26 13:02:41 +0000 (Sat, 26 Feb 2005) $

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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

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
Throws:
IllegalArgumentException - if the filter is null
Method Detail

accept

public boolean accept(File file)
Checks to see if both filters are true.

Specified by:
accept in interface IOFileFilter
Overrides:
accept in class 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 class AbstractFileFilter
Parameters:
file - the File directory
name - the filename
Returns:
true if the filter returns false


Copyright © 2002-2006 The Apache Software Foundation. All Rights Reserved.