public class RegExFilenameFilter extends FileFilter implements FileFilter, FilenameFilter
String.matches(String),
Pattern| Modifier and Type | Class and Description |
|---|---|
static class |
RegExFilenameFilter.Directory
A switch to decide whether the results of a
RegExFilenameFilter are forbidden, allowed or required to be a directory. |
| Constructor and Description |
|---|
RegExFilenameFilter(String desc,
RegExFilenameFilter.Directory dir,
boolean ignoreCase,
String... regex)
Creates a new
RegExFilenameFilter with given
regular expressions regex to be found in the
file name of the Files to be filtered. |
public RegExFilenameFilter(String desc, RegExFilenameFilter.Directory dir, boolean ignoreCase, String... regex)
RegExFilenameFilter with given
regular expressions regex to be found in the
file name of the Files to be filtered.desc - the description of the filter, e.g. "text-files
(*.txt)"dir - a switch whether the results are forbidden, allowed or required to be a directoryignoreCase - indicates whether to ignore the case of the file names or notregex - an array of regular expressions; at least one regular expression has to match
the file namepublic boolean accept(File arg0)
accept in interface FileFilteraccept in class FileFilterpublic boolean accept(File dir, String name)
accept in interface FilenameFilterpublic String getDescription()
getDescription in class FileFilterpublic String getRegEx()