public class FilesystemFilter extends FileFilter implements FilenameFilter
Constructor and Description |
---|
FilesystemFilter(String[] fileext,
String descr,
boolean accDirs)
Creates a new filter.
|
FilesystemFilter(String fileext,
String descr)
Creates a new filter.
|
FilesystemFilter(String fileext,
String descr,
boolean accDirs)
Creates a new filter.
|
Modifier and Type | Method and Description |
---|---|
boolean |
accept(File dir)
Returns
true if the specified file matches the requirements of this
filter, and false otherwise. |
boolean |
accept(File dir,
String name)
Returns
true if the file is accepted, and false otherwise. |
void |
acceptDirectories(boolean b)
Sets the flag that controls whether or not the filter accepts directories.
|
boolean |
acceptsDirectories()
Returns the flag that indicates whether or not the filter accepts directories.
|
String |
getDescription()
Returns the filter description.
|
public FilesystemFilter(String fileext, String descr)
fileext
- the file extension.descr
- the description.public FilesystemFilter(String fileext, String descr, boolean accDirs)
fileext
- the file extension.descr
- the description.accDirs
- accept directories?public FilesystemFilter(String[] fileext, String descr, boolean accDirs)
fileext
- the file extension.descr
- the description.accDirs
- accept directories?NullPointerException
- if the file extensions are null.public boolean accept(File dir, String name)
true
if the file is accepted, and false
otherwise.accept
in interface FilenameFilter
dir
- the directory.name
- the file name.public boolean accept(File dir)
true
if the specified file matches the requirements of this
filter, and false
otherwise.accept
in class FileFilter
dir
- the file or directory.public String getDescription()
getDescription
in class FileFilter
public void acceptDirectories(boolean b)
b
- a boolean.public boolean acceptsDirectories()
Copyright © 2001–2018 JFree.org. All rights reserved.