org.apache.commons.io.filefilter

Class DelegateFileFilter

public class DelegateFileFilter extends AbstractFileFilter implements Serializable

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

Since: Commons IO 1.0

Version: $Revision: 591058 $ $Date: 2007-11-01 15:47:05 +0000 (Thu, 01 Nov 2007) $

Author: Stephen Colebourne

Constructor Summary
DelegateFileFilter(FilenameFilter filter)
Constructs a delegate file filter around an existing FilenameFilter.
DelegateFileFilter(FileFilter filter)
Constructs a delegate file filter around an existing FileFilter.
Method Summary
booleanaccept(File file)
Checks the filter.
booleanaccept(File dir, String name)
Checks the filter.
StringtoString()
Provide a String representaion of this file filter.

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.

Parameters: file the file to check

Returns: true if the filter matches

accept

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

Parameters: dir the directory name the filename in the directory

Returns: true if the filter matches

toString

public String toString()
Provide a String representaion of this file filter.

Returns: a String representaion

Copyright © 2002-2009 Apache Software Foundation. All Rights Reserved.