Top Description Fields Constructors Methods
org.apache.commons.io.filefilter

public Class DelegateFileFilter

extends AbstractFileFilter
Class Inheritance
Imports
java.io.File, .FileFilter, .FilenameFilter

This class turns a Java FileFilter or FilenameFilter into an IO FileFilter.
Author
Stephen Colebourne
Since
Commons IO 1.0
Version
$Revision: 471628 $ $Date: 2006-11-06 05:06:45 +0100 (Mo, 06 Nov 2006) $

Field Summary

Modifier and TypeField and Description
private FileFilter
fileFilter

The File filter

private FilenameFilter
filenameFilter

The Filename filter

Constructor Summary

AccessConstructor and Description
public
DelegateFileFilter(FilenameFilter
the filter to decorate
filter
)

Constructs a delegate file filter around an existing FilenameFilter.

public
DelegateFileFilter(FileFilter
the filter to decorate
filter
)

Constructs a delegate file filter around an existing FileFilter.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if the filter matches
accept
(File
the file to check
file
)

Overrides org.apache.commons.io.filefilter.AbstractFileFilter.accept.

Implements org.apache.commons.io.filefilter.IOFileFilter.accept.

Checks the filter.
public boolean

Returns:

true if the filter matches
accept
(File
the directory
dir
,
String
the filename in the directory
name
)

Overrides org.apache.commons.io.filefilter.AbstractFileFilter.accept.

Implements org.apache.commons.io.filefilter.IOFileFilter.accept.

Checks the filter.

Field Detail

fileFilterback to summary
private FileFilter fileFilter

The File filter

filenameFilterback to summary
private FilenameFilter filenameFilter

The Filename filter

Constructor Detail

DelegateFileFilterback to summary
public DelegateFileFilter(FilenameFilter filter)

Constructs a delegate file filter around an existing FilenameFilter.

Parameters
filter:FilenameFilter

the filter to decorate

DelegateFileFilterback to summary
public DelegateFileFilter(FileFilter filter)

Constructs a delegate file filter around an existing FileFilter.

Parameters
filter:FileFilter

the filter to decorate

Method Detail

acceptback to summary
public boolean accept(File file)

Overrides org.apache.commons.io.filefilter.AbstractFileFilter.accept.

Implements org.apache.commons.io.filefilter.IOFileFilter.accept.

Checks the filter.

Parameters
file:File

the file to check

Returns:boolean

true if the filter matches

acceptback to summary
public boolean accept(File dir, String name)

Overrides org.apache.commons.io.filefilter.AbstractFileFilter.accept.

Implements org.apache.commons.io.filefilter.IOFileFilter.accept.

Checks the filter.

Parameters
dir:File

the directory

name:String

the filename in the directory

Returns:boolean

true if the filter matches