public class AndFileFilter extends Object implements FileFilter, ConditionalFileFilter, Serializable
true if all filters in the list return true.
Otherwise, it returns false. Checking of the file filter list stops
when the first filter returns false.| Constructor and Description |
|---|
AndFileFilter()
Default constructor.
|
AndFileFilter(FileFilter... filters)
Constructs a new file filter that ANDs the result of other filters.
|
AndFileFilter(List<FileFilter> fileFilters)
Constructs a new instance of
AndFileFilter with the specified
list of filters. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
accept(FileSelectInfo fileSelectInfo)
Determines if a file or folder should be selected.
|
void |
addFileFilter(FileFilter fileFilter)
Adds the specified file filter to the list of file filters at the end of the
list.
|
List<FileFilter> |
getFileFilters()
Returns this conditional file filter's list of file filters.
|
boolean |
removeFileFilter(FileFilter fileFilter)
Removes the specified file filter.
|
void |
setFileFilters(List<FileFilter> fileFilters)
Sets the list of file filters, replacing any previously configured file
filters on this filter.
|
String |
toString()
Provide a String representation of this file filter.
|
public AndFileFilter()
public AndFileFilter(FileFilter... filters)
filters - array of filters, must not be null or emptypublic AndFileFilter(List<FileFilter> fileFilters)
AndFileFilter with the specified
list of filters.fileFilters - a List of FileFilter instances, copied, null ignoredpublic boolean accept(FileSelectInfo fileSelectInfo) throws FileSystemException
FileFilteraccept in interface FileFilterfileSelectInfo - the file or folder to select.FileSystemException - Thrown for file system errors (since 2.4.)public void addFileFilter(FileFilter fileFilter)
ConditionalFileFilteraddFileFilter in interface ConditionalFileFilterfileFilter - the filter to be addedpublic List<FileFilter> getFileFilters()
ConditionalFileFiltergetFileFilters in interface ConditionalFileFilterpublic boolean removeFileFilter(FileFilter fileFilter)
ConditionalFileFilterremoveFileFilter in interface ConditionalFileFilterfileFilter - filter to be removedtrue if the filter was found in the list, false
otherwisepublic void setFileFilters(List<FileFilter> fileFilters)
ConditionalFileFiltersetFileFilters in interface ConditionalFileFilterfileFilters - the list of filtersCopyright © 2002–2020 The Apache Software Foundation. All rights reserved.