1 3 package jodd.io.findfile; 4 5 import java.io.File ; 6 import java.util.regex.Pattern ; 7 8 12 public class RegExpFindFile extends FindFile { 13 14 private Pattern regexpPattern; 15 16 public RegExpFindFile(String pattern) { 17 regexpPattern = Pattern.compile(pattern); 18 } 19 20 public RegExpFindFile(String searchPath, String pattern) { 21 regexpPattern = Pattern.compile(pattern); 22 searchPath(searchPath); 23 } 24 25 public RegExpFindFile(File searchPath, String pattern) { 26 regexpPattern = Pattern.compile(pattern); 27 searchPath(searchPath); 28 } 29 30 public RegExpFindFile(String [] searchPath, String pattern) { 31 regexpPattern = Pattern.compile(pattern); 32 searchPath(searchPath); 33 } 34 35 protected boolean onFileEntry(File currentFile) { 36 return regexpPattern.matcher(currentFile.getName()).matches(); 37 } 38 } 39 | Popular Tags |