ORO, Inc. Logo  All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.oroinc.io.RegexFilenameFilter

java.lang.Object
   |
   +----com.oroinc.io.RegexFilenameFilter

public abstract class RegexFilenameFilter
extends Object
implements FilenameFilter
RegexFilenameFilter is the base class for a set of FilenameFilter implementations that filter based on a regular expression.

Copyright © 1997 Original Resuable Objects, Inc. All rights reserved.

See Also:
Perl5FilenameFilter, AwkFilenameFilter, GlobFilenameFilter

Method Index

 o accept(File, String)
Filters a filename.
 o setFilterExpression(String)
Set the regular expression on which to filter.
 o setFilterExpression(String, int)
Set the regular expression on which to filter along with any special options to use when compiling the expression.

Methods

 o setFilterExpression
 public void setFilterExpression(String regex) throws MalformedCachePatternException
Set the regular expression on which to filter.

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.
 o setFilterExpression
 public void setFilterExpression(String regex,
                                 int options) throws MalformedCachePatternException
Set the regular expression on which to filter along with any special options to use when compiling the expression.

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.
 o accept
 public boolean accept(File dir,
                       String filename)
Filters a filename. Tests if the filename EXACTLY matches the pattern contained by the filter. The directory argument is not examined.

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.

ORO, Inc. Logo  All Packages  Class Hierarchy  This Package  Previous  Next  Index