public class OrFileFilter extends Object implements FileFilter, ConditionalFileFilter, Serializable
FileFilter providing conditional OR logic across a list of
file filters. This filter returns true if any filters in the list
return true. Otherwise, it returns false. Checking of the
file filter list stops when the first filter returns true.| Constructor and Description |
|---|
OrFileFilter()
Default constructor.
|
OrFileFilter(FileFilter... filters)
Constructs a new file filter that ORs the result of other filters.
|
OrFileFilter(List<FileFilter> fileFilters)
Constructs a new instance of
OrFileFilter with the specified
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 OrFileFilter()
public OrFileFilter(FileFilter... filters)
filters - array of filters, must not be null or emptypublic OrFileFilter(List<FileFilter> fileFilters)
OrFileFilter with the specified
filters.fileFilters - the file filters for this filter, 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.