org.apache.oro.io
public abstract class RegexFilenameFilter extends Object implements FilenameFilter, FileFilter
Since: 1.0
Version: 2.0.8
See Also: Perl5FilenameFilter AwkFilenameFilter GlobFilenameFilter
Method Summary | |
---|---|
boolean | accept(File dir, String filename)
Filters a filename. |
boolean | accept(File pathname)
Filters a filename. |
void | setFilterExpression(String regex)
Set the regular expression on which to filter.
|
void | setFilterExpression(String regex, int options)
Set the regular expression on which to filter along with any
special options to use when compiling the expression.
|
Parameters: dir The directory containing the file. filename The name of the file.
Returns: True if the filename EXACTLY matches the pattern, false if not.
Parameters: pathname The file pathname.
Returns: True if the filename EXACTLY matches the pattern, false if not.
Parameters: regex The regular expression on which to filter.
Throws: 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.
Parameters: regex The regular expression on which to filter. options A set of compilation options specific to the regular expression grammar being used.
Throws: 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.