public abstract class RegexFilenameFilter
extends java.lang.Object
implements java.io.FilenameFilter, java.io.FileFilter
Perl5FilenameFilter
,
AwkFilenameFilter
,
GlobFilenameFilter
Modifier and Type | Method and Description |
---|---|
boolean |
accept(java.io.File pathname)
Filters a filename.
|
boolean |
accept(java.io.File dir,
java.lang.String filename)
Filters a filename.
|
void |
setFilterExpression(java.lang.String regex)
Set the regular expression on which to filter.
|
void |
setFilterExpression(java.lang.String regex,
int options)
Set the regular expression on which to filter along with any
special options to use when compiling the expression.
|
public void setFilterExpression(java.lang.String regex) throws MalformedCachePatternException
regex
- The regular expression on which to filter.MalformedCachePatternException
- If there is an error in
compiling the regular expression. This need not be caught if
you are using a hard-coded expression that you know is correct.
But for robustness and reliability you should catch this exception
for dynamically entered expressions determined at runtime.public void setFilterExpression(java.lang.String regex, int options) throws MalformedCachePatternException
regex
- The regular expression on which to filter.options
- A set of compilation options specific to the regular
expression grammar being used.MalformedCachePatternException
- If there is an error in
compiling the regular expression. This need not be caught if
you are using a hard-coded expression that you know is correct.
But for robustness and reliability you should catch this exception
for dynamically entered expressions determined at runtime.public boolean accept(java.io.File dir, java.lang.String filename)
accept
in interface java.io.FilenameFilter
dir
- The directory containing the file.filename
- The name of the file.public boolean accept(java.io.File pathname)
accept
in interface java.io.FileFilter
pathname
- The file pathname.Copyright ? 2000-2003 Apache Software Foundation. All Rights Reserved.