Class ChainedFileSelector
java.lang.Object
fc.io.fileselectors.ChainedFileSelector
- All Implemented Interfaces:
FileFilter
- Direct Known Subclasses:
DirectorySelector, FilePrefixRejectSelector, FilePrefixSelector, MaxSizeSelector, MinSizeSelector, NormalFileSelector, SuffixRejectSelector, SuffixSelector
Allows for chaining FileFilters, used in java.io.File directory
listing methods. Chained filters allow all filters in the chain
to take turns accepting/rejecting a particular file name. The file
name is only accepted if all filters in the chain accept that
file. Example usage:
java.io.File startdir = new java.io.File("\some\path\here");
String filepattern = "gif,jpg";
ChainedFileFilter filter = new SuffixFilter(filepattern, new NormalFileFilter());
File[] files = startdir.listFiles(filter);
The above will only list files (not directories) ending with
gif or jpg.-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
ChainedFileSelector
- Parameters:
cf- the next selector in the chain. Pass in null if there is no following selector in the chain.
-
-
Method Details
-
accept
- Specified by:
acceptin interfaceFileFilter
-