|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.clapper.util.io.RegexFileFilter
public class RegexFileFilter
RegexFileFilter implements a java.io.FileFilter
class that matches files using a regular expression. Multiple regular
expression filters can be combined using AndFileFilter
and/or OrFileFilter objects.
A RegexFileFilter can be configured to operate on just the simple file name, or on the file's path.
RegexFileFilter uses the java.util.regex regular expression classes.
AndFileFilter,
OrFileFilter,
NotFileFilter,
RegexFilenameFilter| Constructor Summary | |
|---|---|
RegexFileFilter(java.lang.String regex,
FileFilterMatchType matchType)
Construct a new RegexFileFilter using the specified pattern. |
|
RegexFileFilter(java.lang.String regex,
int regexFlags,
FileFilterMatchType matchType)
Construct a new RegexFileFilter using the specified pattern. |
|
| Method Summary | |
|---|---|
boolean |
accept(java.io.File file)
Determine whether a file is to be accepted or not, based on the regular expressions in the reject and accept lists. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RegexFileFilter(java.lang.String regex,
FileFilterMatchType matchType)
throws java.util.regex.PatternSyntaxException
regex - the regular expression to addmatchType - FileFilterMatchType.FILENAME to match just the
filename, FileFilterMatchType.PATH to match
the path (via java.io.File.getPath())
java.util.regex.PatternSyntaxException - bad regular expression
public RegexFileFilter(java.lang.String regex,
int regexFlags,
FileFilterMatchType matchType)
throws java.util.regex.PatternSyntaxException
regex - the regular expression to addregexFlags - regular expression compilation flags (e.g.,
Pattern.CASE_INSENSITIVE). See
the Javadocs for java.util.regex for
legal values.matchType - FileFilterMatchType.FILENAME to match just the
filename, FileFilterMatchType.PATH to match
the path (via java.io.File.getPath())
java.util.regex.PatternSyntaxException - bad regular expression| Method Detail |
|---|
public boolean accept(java.io.File file)
accept in interface java.io.FileFilterfile - The file to test. If the match type is
FileFilterMatchType.FILENAME, then the value
of file.getPath() is compared to the regular
expression. If the match type is
FileFilterMatchType.PATH, then the value of
file.getName() is compared to the regular
expression.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||