类 RegexFilenameFilter
java.lang.Object
org.apache.oro.io.RegexFilenameFilter
- 所有已实现的接口:
FileFilter,FilenameFilter
RegexFilenameFilter is the base class for a set of FilenameFilter
implementations that filter based on a regular expression.
- 从以下版本开始:
- 1.0
- 版本:
- @version@
- 另请参阅:
-
方法概要
修饰符和类型方法说明booleanFilters a filename.booleanFilters a filename.voidsetFilterExpression(String regex) Set the regular expression on which to filter.voidsetFilterExpression(String regex, int options) Set the regular expression on which to filter along with any special options to use when compiling the expression.
-
方法详细资料
-
setFilterExpression
Set the regular expression on which to filter.- 参数:
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.
-
setFilterExpression
Set the regular expression on which to filter along with any special options to use when compiling the expression.- 参数:
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.
-
accept
Filters a filename. Tests if the filename EXACTLY matches the pattern contained by the filter. The directory argument is not examined. Conforms to the java.io.FilenameFilter interface.- 指定者:
accept在接口中FilenameFilter- 参数:
dir- The directory containing the file.filename- The name of the file.- 返回:
- True if the filename EXACTLY matches the pattern, false if not.
-
accept
Filters a filename. Tests if the filename EXACTLY matches the pattern contained by the filter. The filename is defined as pathname.getName(). Conforms to the java.io.FileFilter interface.- 指定者:
accept在接口中FileFilter- 参数:
pathname- The file pathname.- 返回:
- True if the filename EXACTLY matches the pattern, false if not.
-