public class XdevFileFilter extends FileFilter
FileNameExtensionFilter
, but this filter works with
extensions which includes a dot '.' .Constructor and Description |
---|
XdevFileFilter(String description,
String... extensions)
Creates a
XdevFileFilter with the specified description and file
name extensions. |
Modifier and Type | Method and Description |
---|---|
boolean |
accept(File f)
Tests the specified file, returning true if the file is accepted, false
otherwise.
|
File |
ensureFileEndsWithExtension(File file)
Ensures that the
file 's name ends with a extension of this
filter. |
String |
getDescription()
The description of this filter.
|
String[] |
getExtensions()
Returns the set of file name extensions files are tested against.
|
public XdevFileFilter(String description, String... extensions) throws IllegalArgumentException
XdevFileFilter
with the specified description and file
name extensions. The returned XdevFileFilter
will accept all
directories and any file with a file name extension contained in
extensions
.description
- textual description for the filter, may be null
extensions
- the accepted file name extensions without a leading dot, e.g.
"zip" not ".zip"IllegalArgumentException
- if extensions is null
, empty, contains null
,
or contains an empty stringaccept(java.io.File)
public boolean accept(File f)
FileFilter
, or the file is a directory.accept
in class FileFilter
f
- the File
to testpublic String getDescription()
getDescription
in class FileFilter
public String[] getExtensions()
Copyright © 2003–2021 XDEV Software. All rights reserved.