org.apache.commons.io.filefilter
Class DelegateFileFilter

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

public class DelegateFileFilter
extends AbstractFileFilter

This class turns a Java FileFilter or FilenameFilter into an IO FileFilter.

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

Constructor Summary
DelegateFileFilter(FileFilter filter)
          Constructs a delegate file filter around an existing FileFilter.
DelegateFileFilter(FilenameFilter filter)
          Constructs a delegate file filter around an existing FilenameFilter.
 
Method Summary
 boolean accept(File file)
          Checks the filter.
 boolean accept(File dir, String name)
          Checks the filter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DelegateFileFilter

public DelegateFileFilter(FilenameFilter filter)
Constructs a delegate file filter around an existing FilenameFilter.

Parameters:
filter - the filter to decorate

DelegateFileFilter

public DelegateFileFilter(FileFilter filter)
Constructs a delegate file filter around an existing FileFilter.

Parameters:
filter - the filter to decorate
Method Detail

accept

public boolean accept(File file)
Checks the filter.

Specified by:
accept in interface IOFileFilter
Overrides:
accept in class AbstractFileFilter
Parameters:
file - the file to check
Returns:
true if the filter matches

accept

public boolean accept(File dir,
                      String name)
Checks the filter.

Specified by:
accept in interface IOFileFilter
Overrides:
accept in class AbstractFileFilter
Parameters:
dir - the directory
name - the filename in the directory
Returns:
true if the filter matches


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