org.apache.commons.io.filefilter

Class TrueFileFilter

Implemented Interfaces:
FileFilter, FilenameFilter, IOFileFilter

public class TrueFileFilter
extends java.lang.Object
implements IOFileFilter

A file filter that always returns true.
Version:
$Revision: 471628 $ $Date: 2006-11-06 05:06:45 +0100 (Mo, 06 Nov 2006) $
Author:
Stephen Colebourne
Since:
Commons IO 1.0

Field Summary

static IOFileFilter
INSTANCE
Singleton instance of true filter.
static IOFileFilter
TRUE
Singleton instance of true filter.

Constructor Summary

TrueFileFilter()
Restrictive consructor.

Method Summary

boolean
accept(File file)
Returns true.
boolean
accept(File dir, String name)
Returns true.

Field Details

INSTANCE

public static final IOFileFilter INSTANCE
Singleton instance of true filter. Please use the identical TrueFileFilter.TRUE constant. The new name is more JDK 1.5 friendly as it doesn't clash with other values when using static imports.

TRUE

public static final IOFileFilter TRUE
Singleton instance of true filter.
Since:
Commons IO 1.3

Constructor Details

TrueFileFilter

protected TrueFileFilter()
Restrictive consructor.

Method Details

accept

public boolean accept(File file)
Returns true.
Specified by:
accept in interface IOFileFilter
Parameters:
file - the file to check
Returns:
true

accept

public boolean accept(File dir,
                      String name)
Returns true.
Specified by:
accept in interface IOFileFilter
Parameters:
dir - the directory to check
name - the filename
Returns:
true