private static Glob glob(String match) { return new Glob(match); }
private Collection<Predicate<String>> globStringsToPredicates( final List<String> excludedMethods) { return FCollection.map(excludedMethods, Glob.toGlobPredicate()); }
private static Predicate<MethodInfo> stringToMethodInfoPredicate( final Collection<String> excludedMethods) { final Predicate<String> excluded = Prelude.or(Glob.toGlobPredicates(excludedMethods)); return a -> excluded.test(a.getName()); }
public static void walk(Path start, String searchGlob) throws IOException { final Glob glob = new Glob(searchGlob); Files.walkFileTree(start, new SimpleFileVisitor<Path>() { @Override public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { if (glob.matchesFile(file)) { ...; // Process file } return FileVisitResult.CONTINUE; } @Override public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException { return glob.matchesParentDir(dir) ? FileVisitResult.CONTINUE : FileVisitResult.SKIP_SUBTREE; } }); }
@Override public boolean test(final String value) { return matches(value); }
public Glob(final String glob) { if (glob.startsWith("~")) { this.regex = Pattern.compile(glob.substring(1)); } else { this.regex = Pattern.compile(convertGlobToRegex(glob) ); } }
@Override public boolean test(final String value) { return matches(value); }
public Glob(final String glob) { if (glob.startsWith("~")) { this.regex = Pattern.compile(glob.substring(1)); } else { this.regex = Pattern.compile(convertGlobToRegex(glob) ); } }
protected Collection<Predicate<String>> predicateFor(final String... glob) { return Glob.toGlobPredicates(Arrays.asList(glob)); }
public static Function<String, Predicate<String>> toGlobPredicate() { return glob -> new Glob(glob); }
public static Collection<Predicate<String>> toGlobPredicates( final Collection<String> globs) { return FCollection.map(globs, Glob.toGlobPredicate()); }
IgnoreCoreClasses() { this.impl = Prelude.not(Prelude.or(Glob.toGlobPredicates(this.filtered))); }
@Override public Predicate<String> apply(String a) { return new Glob(a.replace(".java", "").replace("/", ".")); } };
private Collection<Predicate<String>> determineTargetTests() { return FCollection.map(this.mojo.getTargetTests(), Glob.toGlobPredicate()); }
private Predicate<ClassPathRoot> createCodePathFilter() { if ((this.codePaths != null) && !this.codePaths.isEmpty()) { return new PathNamePredicate(Prelude.or(Glob .toGlobPredicates(this.codePaths))); } else { return new DefaultCodePathPredicate(); } }