java.io.FilenameFilter
public class FilesystemFilter
extends javax.swing.filechooser.FileFilter
implements java.io.FilenameFilter
Constructor | Description |
---|---|
FilesystemFilter(java.lang.String[] fileext,
java.lang.String descr,
boolean accDirs) |
Creates a new filter.
|
FilesystemFilter(java.lang.String fileext,
java.lang.String descr) |
Creates a new filter.
|
FilesystemFilter(java.lang.String fileext,
java.lang.String descr,
boolean accDirs) |
Creates a new filter.
|
Modifier and Type | Method | Description |
---|---|---|
boolean |
accept(java.io.File dir) |
Returns
true if the specified file matches the requirements of this
filter, and false otherwise. |
boolean |
accept(java.io.File dir,
java.lang.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.
|
boolean |
equals(java.lang.Object o) |
|
java.lang.String |
getDescription() |
Returns the filter description.
|
int |
hashCode() |
public FilesystemFilter(java.lang.String fileext, java.lang.String descr)
fileext
- the file extension.descr
- the description.public FilesystemFilter(java.lang.String fileext, java.lang.String descr, boolean accDirs)
fileext
- the file extension.descr
- the description.accDirs
- accept directories?public FilesystemFilter(java.lang.String[] fileext, java.lang.String descr, boolean accDirs)
fileext
- the file extension.descr
- the description.accDirs
- accept directories?java.lang.NullPointerException
- if the file extensions are null.public boolean accept(java.io.File dir, java.lang.String name)
true
if the file is accepted, and false
otherwise.accept
in interface java.io.FilenameFilter
dir
- the directory.name
- the file name.public boolean accept(java.io.File dir)
true
if the specified file matches the requirements of this
filter, and false
otherwise.accept
in class javax.swing.filechooser.FileFilter
dir
- the file or directory.public java.lang.String getDescription()
getDescription
in class javax.swing.filechooser.FileFilter
public void acceptDirectories(boolean b)
b
- a boolean.public boolean acceptsDirectories()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object