Home | History | Annotate | Download | only in filefilter

Lines Matching refs:Pattern

21 import java.util.regex.Pattern;

28 * See java.util.regex.Pattern for regex matching rules
48 /** The regular expression pattern that will be used to match filenames */
49 private final Pattern pattern;
54 * @param pattern regular string expression to match
55 * @throws IllegalArgumentException if the pattern is null
57 public RegexFileFilter(String pattern) {
58 if (pattern == null) {
59 throw new IllegalArgumentException("Pattern is missing");
62 this.pattern = Pattern.compile(pattern);
68 * @param pattern regular string expression to match
70 * @throws IllegalArgumentException if the pattern is null
72 public RegexFileFilter(String pattern, IOCase caseSensitivity) {
73 if (pattern == null) {
74 throw new IllegalArgumentException("Pattern is missing");
78 flags = Pattern.CASE_INSENSITIVE;
80 this.pattern = Pattern.compile(pattern, flags);
86 * @param pattern regular string expression to match
87 * @param flags pattern flags - e.g. {@link Pattern#CASE_INSENSITIVE}
88 * @throws IllegalArgumentException if the pattern is null
90 public RegexFileFilter(String pattern, int flags) {
91 if (pattern == null) {
92 throw new IllegalArgumentException("Pattern is missing");
94 this.pattern = Pattern.compile(pattern, flags);
100 * @param pattern regular expression to match
101 * @throws IllegalArgumentException if the pattern is null
103 public RegexFileFilter(Pattern pattern) {
104 if (pattern == null) {
105 throw new IllegalArgumentException("Pattern is missing");
108 this.pattern = pattern;
119 return (pattern.matcher(name).matches());