@Test public void globber() throws Exception { Path globberDir = FileHelper.resourceAsFile("/globber/globber.txt").getParentFile().toPath(); String globberPath = BasicPaths.toString(globberDir); Path hiddenDir = globberDir.resolve(".hidden"); Files.deleteIfExists(hiddenDir); List<Path> paths; paths = Globber.globber(globberPath).scan(); assertThat(paths, hasSize(1)); assertThat(paths.get(0), is(globberDir)); paths = Globber.globber(globberPath + "/src").scan(); assertThat(paths, hasSize(1)); assertThat(paths.get(0), is(globberDir.resolve("src"))); paths = Globber.globber(globberPath + "/*").scan(); assertThat(paths, hasSize(3)); assertThat(paths, containsInAnyOrder( globberDir.resolve("globber.html"), globberDir.resolve("globber.txt"), globberDir.resolve("src"))); paths = Globber.globber(globberPath + "/**").scan(); assertThat(paths, hasSize(5)); assertThat(paths, containsInAnyOrder( globberDir.resolve("globber.html"), globberDir.resolve("globber.txt"), globberDir.resolve("src"), globberDir.resolve("src/java"), globberDir.resolve("src/java/java.txt"))); paths = Globber.globber(globberPath + "/*.html").scan(); assertThat(paths, hasSize(1)); assertThat(paths, containsInAnyOrder( globberDir.resolve("globber.html"))); paths = Globber.globber(globberPath + "/*.{txt,html}").scan(); assertThat(paths, hasSize(2)); assertThat(paths, containsInAnyOrder( globberDir.resolve("globber.html"), globberDir.resolve("globber.txt"))); paths = Globber.globber(globberPath + "/????ber.{txt,html}").scan(); assertThat(paths, hasSize(2)); assertThat(paths, containsInAnyOrder( globberDir.resolve("globber.html"), globberDir.resolve("globber.txt"))); paths = Globber.globber(globberPath + "/*").filesOnly().scan(); assertThat(paths, hasSize(2)); assertThat(paths, containsInAnyOrder( globberDir.resolve("globber.html"), globberDir.resolve("globber.txt"))); paths = Globber.globber(globberPath + "/*").dirsOnly().scan(); assertThat(paths, hasSize(1)); assertThat(paths, containsInAnyOrder( globberDir.resolve("src"))); paths = Globber.globber(globberPath + "/*").filesOnly().dirsOnly().scan(); assertThat(paths, hasSize(0)); Files.createDirectory(hiddenDir); paths = Globber.globber(globberPath + "/*").scan(); assertThat(paths, hasSize(4)); assertThat(paths, containsInAnyOrder( hiddenDir, globberDir.resolve("globber.html"), globberDir.resolve("globber.txt"), globberDir.resolve("src"))); paths = Globber.globber(globberPath + "/*").visibleOnly().scan(); assertThat(paths, hasSize(3)); assertThat(paths, containsInAnyOrder( globberDir.resolve("globber.html"), globberDir.resolve("globber.txt"), globberDir.resolve("src"))); }
public Globber() { this((Path)null); }
Globber { public Globber() { this((Path)null); } }
Globber { public Globber() { this((Path)null); } Globber();  Globber(String root);  Globber(Path root); }
Globber { public Globber() { this((Path)null); } Globber();  Globber(String root);  Globber(Path root); Globber include(String glob); Globber include(PathMatcher matcher); Globber exclude(String glob); Globber exclude(PathMatcher matcher); Globber recursive(); Globber recursive(boolean recursive); Globber dirsOnly(); Globber dirsOnly(boolean dirsOnly); Globber filesOnly(); Globber filesOnly(boolean filesOnly); Globber visibleOnly(); Globber visibleOnly(boolean visibleOnly); Stream<Path> stream(); Path scanOne(); Path scanOne(boolean required); List<Path> scan(); static Globber globber(String root, String glob); static Globber globber(Path root, String glob); static Globber globber(String rootWithGlob); static int detectGlobIndex(List<String> paths); }
Globber { public Globber() { this((Path)null); } Globber();  Globber(String root);  Globber(Path root); Globber include(String glob); Globber include(PathMatcher matcher); Globber exclude(String glob); Globber exclude(PathMatcher matcher); Globber recursive(); Globber recursive(boolean recursive); Globber dirsOnly(); Globber dirsOnly(boolean dirsOnly); Globber filesOnly(); Globber filesOnly(boolean filesOnly); Globber visibleOnly(); Globber visibleOnly(boolean visibleOnly); Stream<Path> stream(); Path scanOne(); Path scanOne(boolean required); List<Path> scan(); static Globber globber(String root, String glob); static Globber globber(Path root, String glob); static Globber globber(String rootWithGlob); static int detectGlobIndex(List<String> paths); static final char[] JAVA_GLOBBING_CHARS; }