public class FilenameExtensionFilter
extends java.lang.Object
implements java.io.FilenameFilter
Constructor and Description |
---|
FilenameExtensionFilter()
Construct a FilenameExtensionFilter with an empty extension
list.
|
FilenameExtensionFilter(java.util.Collection<java.lang.String> collection)
Construct a FilenameExtensionFilter with a collection of
extensions.
|
FilenameExtensionFilter(java.lang.String[] extensions)
Construct a FilenamExtensionFilter with an array of extensions.
|
Modifier and Type | Method and Description |
---|---|
boolean |
accept(java.io.File dir,
java.lang.String name) |
void |
add(java.lang.String extension)
Add an extension string to the internal list of extensions.
|
void |
add(java.lang.String[] extensions)
Add an array of extension strings to the internal list.
|
void |
remove(java.lang.String extension)
Remove an extension from the internal list.
|
void |
remove(java.lang.String[] extensions)
Remove an array of extensions from the internal list.
|
public FilenameExtensionFilter()
public FilenameExtensionFilter(java.util.Collection<java.lang.String> collection)
collection
- collection of file extension stringspublic FilenameExtensionFilter(java.lang.String[] extensions)
extensions
- array of filename extension stringspublic void add(java.lang.String extension)
extension
- string with the extension to addpublic void add(java.lang.String[] extensions)
extensions
- array of string extensions to addpublic void remove(java.lang.String extension)
extension
- the string extension to removepublic void remove(java.lang.String[] extensions)
extensions
- array of string extensions to removepublic boolean accept(java.io.File dir, java.lang.String name)
accept
in interface java.io.FilenameFilter
dir
- the directory in which the file was foundname
- the name of the file to checktrue
if the filename ends with one of the
extensions in the internal list; false
otherwise