public static RegExpFindFile createRegExpFF() { return new RegExpFindFile(); } public static FindFile create() {
@Test void testRegexp() { FindFile ff = FindFile.createRegExpFF() .include(".*/a[.].*") .recursive(true) .includeDirs(true) .searchPath(dataRoot); int countDirs = 0; int countFiles = 0; File f; while ((f = ff.nextFile()) != null) { if (f.isDirectory()) { countDirs++; } else { countFiles++; String path = f.getAbsolutePath(); path = FileNameUtil.separatorsToUnix(path); if (!path.startsWith("/")) { path = '/' + path; } boolean matched = path.equals(dataRoot + "/file/a.png") || path.equals(dataRoot + "/file/a.txt"); assertTrue(matched); } } assertEquals(0, countDirs); assertEquals(2, countFiles); }
public static RegExpFindFile create() { return new RegExpFindFile(); }
public static RegExpFindFile createRegExpFF() { return new RegExpFindFile(); } public static FindFile create() {
public static RegExpFindFile create() { return new RegExpFindFile(); }