public class DefaultFileFilter extends FileFilter implements FileFilter, FilenameFilter
FileFilter
implementation using Unix-style wildcards.Constructor and Description |
---|
DefaultFileFilter(String pattern)
Constructs a file filter for the specified pattern.
|
DefaultFileFilter(String pattern,
String description)
Constructs a file filter for the specified pattern and description.
|
Modifier and Type | Method and Description |
---|---|
boolean |
accept(File file)
Tests if a specified file matches the pattern.
|
boolean |
accept(File directory,
String name)
Tests if a specified file matches the pattern.
|
String |
getDescription()
Returns the description of this filter.
|
public DefaultFileFilter(String pattern)
"*"
and "?"
wildcards.pattern
- The pattern (e.g. "*.png"
).public DefaultFileFilter(String pattern, String description)
"*"
and "?"
wildcards.pattern
- The pattern (e.g. "*.png"
).description
- The description of this filter, usually for graphical user interfaces.public String getDescription()
"PNG images"
.getDescription
in class FileFilter
public boolean accept(File file)
accept
in interface FileFilter
accept
in class FileFilter
file
- The file to be tested.true
if and only if the name matches the pattern.public boolean accept(File directory, String name)
accept
in interface FilenameFilter
directory
- The directory in which the file was found.name
- The name of the file.true
if and only if the name matches the pattern.Copyright © 1996–2023 Geotools. All rights reserved.