Package org.apache.commons.io.filefilter
Class TrueFileFilter
java.lang.Object
org.apache.commons.io.filefilter.TrueFileFilter
- All Implemented Interfaces:
FileFilter
,FilenameFilter
,Serializable
,PathFilter
,IOFileFilter
A file filter that always returns true.
- Since:
- 1.0
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final IOFileFilter
Singleton instance of true filter.static final IOFileFilter
Singleton instance of true filter.Fields inherited from interface org.apache.commons.io.filefilter.IOFileFilter
EMPTY_STRING_ARRAY
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns true.boolean
Returns true.accept
(Path file, BasicFileAttributes attributes) Returns true.and
(IOFileFilter fileFilter) Creates a new "and" filter with this filter.negate()
Creates a new "not" filter with this filter.or
(IOFileFilter fileFilter) Creates a new "or" filter with this filter.toString()
-
Field Details
-
TRUE
Singleton instance of true filter.- Since:
- 1.3
-
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.
-
-
Constructor Details
-
TrueFileFilter
protected TrueFileFilter()Restrictive constructor.
-
-
Method Details
-
accept
Returns true.- Specified by:
accept
in interfaceFileFilter
- Specified by:
accept
in interfaceIOFileFilter
- Parameters:
file
- the file to check (ignored)- Returns:
- true
-
accept
Returns true.- Specified by:
accept
in interfaceFilenameFilter
- Specified by:
accept
in interfaceIOFileFilter
- Parameters:
dir
- the directory to check (ignored)name
- the file name (ignored)- Returns:
- true
-
accept
Returns true.- Specified by:
accept
in interfaceIOFileFilter
- Specified by:
accept
in interfacePathFilter
- Parameters:
file
- the file to check (ignored)attributes
- the file's basic attributes (TODO may be null).- Returns:
- true
- Since:
- 2.9.0
-
negate
Description copied from interface:IOFileFilter
Creates a new "not" filter with this filter.- Specified by:
negate
in interfaceIOFileFilter
- Returns:
- a new filter.
-
or
Description copied from interface:IOFileFilter
Creates a new "or" filter with this filter.- Specified by:
or
in interfaceIOFileFilter
- Parameters:
fileFilter
- the filter to "or".- Returns:
- a new filter.
-
and
Description copied from interface:IOFileFilter
Creates a new "and" filter with this filter.- Specified by:
and
in interfaceIOFileFilter
- Parameters:
fileFilter
- the filter to "and".- Returns:
- a new filter.
-
toString
-