Useful utilities for working with file filters. It provides access to all
file filter implementations in this package so you don't have to import
every class you use.
since: Commons IO 1.0 version: $Id: FileFilterUtils.java 471628 2006-11-06 04:06:45Z bayard $ author: Stephen Colebourne author: Jeremias Maerki author: Masato Tezuka author: Rahul Akolkar
Constructor Summary
public
FileFilterUtils() FileFilterUtils is not normally instantiated.
sizeRangeFileFilter(long minSizeInclusive, long maxSizeInclusive) Returns a filter that accepts files whose size is >= minimum size
and <= maximum size.
Returns a filter that returns true if the file was last modified after
the specified cutoff time.
Parameters: cutoff - the time threshold an appropriately configured age file filter since: Commons IO 1.2
ageFileFilter
public static IOFileFilter ageFileFilter(long cutoff, boolean acceptOlder)(Code)
Returns a filter that filters files based on a cutoff time.
Parameters: cutoff - the time threshold Parameters: acceptOlder - if true, older files get accepted, if false, newer an appropriately configured age file filter since: Commons IO 1.2
Returns a filter that returns true if the file was last modified after
the specified cutoff date.
Parameters: cutoffDate - the time threshold an appropriately configured age file filter since: Commons IO 1.2
Returns a filter that filters files based on a cutoff date.
Parameters: cutoffDate - the time threshold Parameters: acceptOlder - if true, older files get accepted, if false, newer an appropriately configured age file filter since: Commons IO 1.2
Returns a filter that returns true if the file was last modified after
the specified reference file.
Parameters: cutoffReference - the file whose last modificationtime is usesd as the threshold age of the files an appropriately configured age file filter since: Commons IO 1.2
ageFileFilter
public static IOFileFilter ageFileFilter(File cutoffReference, boolean acceptOlder)(Code)
Returns a filter that filters files based on a cutoff reference file.
Parameters: cutoffReference - the file whose last modificationtime is usesd as the threshold age of the files Parameters: acceptOlder - if true, older files get accepted, if false, newer an appropriately configured age file filter since: Commons IO 1.2
Returns a filter that ANDs the two specified filters.
Parameters: filter1 - the first filter Parameters: filter2 - the second filter a filter that ANDs the two specified filters
Returns an IOFileFilter that wraps the
FilenameFilter instance.
Parameters: filter - the filter to be wrapped a new filter that implements IOFileFilter
Decorates a filter to make it ignore CVS directories.
Passing in null will return a filter that accepts everything
except CVS directories.
Parameters: filter - the filter to decorate, null means an unrestricted filter the decorated filter, never null since: 1.1 (method existed but had bug in 1.0)
Decorates a filter so that it only applies to directories and not to files.
Parameters: filter - the filter to decorate, null means an unrestricted filter the decorated filter, never null since: 1.3
Decorates a filter so that it only applies to files and not to directories.
Parameters: filter - the filter to decorate, null means an unrestricted filter the decorated filter, never null since: 1.3
Decorates a filter to make it ignore SVN directories.
Passing in null will return a filter that accepts everything
except SVN directories.
Parameters: filter - the filter to decorate, null means an unrestricted filter the decorated filter, never null since: 1.1
Returns a filter that ORs the two specified filters.
Parameters: filter1 - the first filter Parameters: filter2 - the second filter a filter that ORs the two specified filters
Returns a filter that returns true if the file is bigger than a certain size.
Parameters: threshold - the file size threshold an appropriately configured SizeFileFilter since: Commons IO 1.2
sizeFileFilter
public static IOFileFilter sizeFileFilter(long threshold, boolean acceptLarger)(Code)
Returns a filter that filters based on file size.
Parameters: threshold - the file size threshold Parameters: acceptLarger - if true, larger files get accepted, if false, smaller an appropriately configured SizeFileFilter since: Commons IO 1.2
sizeRangeFileFilter
public static IOFileFilter sizeRangeFileFilter(long minSizeInclusive, long maxSizeInclusive)(Code)
Returns a filter that accepts files whose size is >= minimum size
and <= maximum size.
Parameters: minSizeInclusive - the minimum file size (inclusive) Parameters: maxSizeInclusive - the maximum file size (inclusive) an appropriately configured IOFileFilter since: Commons IO 1.3