|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.armatiek.infofuze.stream.filesystem.filefilter.RegexFileFilter
public class RegexFileFilter
Filters files using supplied regular expression(s).
Based on code from Apache Commons IO version 2.01.
The main difference is that this class filters objects that
implement FileIf
,
not File
.
Original author Oliver Siegmar
Constructor Summary | |
---|---|
RegexFileFilter(java.util.regex.Pattern pattern)
Construct a new regular expression filter for a compiled regular expression |
|
RegexFileFilter(java.lang.String pattern)
Construct a new regular expression filter. |
|
RegexFileFilter(java.lang.String pattern,
int flags)
Construct a new regular expression filter with the specified flags. |
|
RegexFileFilter(java.lang.String pattern,
org.apache.commons.io.IOCase caseSensitivity)
Construct a new regular expression filter with the specified flags case sensitivity. |
Method Summary | |
---|---|
boolean |
accept(FileIf file)
Checks to see if the filename matches one of the regular expressions. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RegexFileFilter(java.lang.String pattern)
pattern
- regular string expression to match
java.lang.IllegalArgumentException
- if the pattern is nullpublic RegexFileFilter(java.lang.String pattern, org.apache.commons.io.IOCase caseSensitivity)
pattern
- regular string expression to matchcaseSensitivity
- how to handle case sensitivity, null means case-sensitive
java.lang.IllegalArgumentException
- if the pattern is nullpublic RegexFileFilter(java.lang.String pattern, int flags)
pattern
- regular string expression to matchflags
- pattern flags - e.g. Pattern.CASE_INSENSITIVE
java.lang.IllegalArgumentException
- if the pattern is nullpublic RegexFileFilter(java.util.regex.Pattern pattern)
pattern
- regular expression to match
java.lang.IllegalArgumentException
- if the pattern is nullMethod Detail |
---|
public boolean accept(FileIf file)
accept
in interface IOFileFilter
dir
- the file directoryname
- the filename
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |