/** * Create a new tree filter for a user supplied path suffix. * <p> * Path strings use '/' to delimit directories on all platforms. * * @param path * the path suffix to filter on. Must not be the empty string. * @return a new filter for the requested path. * @throws java.lang.IllegalArgumentException * the path supplied was the empty string. */ public static PathSuffixFilter create(String path) { if (path.length() == 0) throw new IllegalArgumentException(JGitText.get().emptyPathNotPermitted); return new PathSuffixFilter(path); }
private static TreeFilter[] suffix(final String... paths) { final int length = paths.length; final TreeFilter[] filters = new TreeFilter[length]; for (int i = 0; i < length; i++) filters[i] = PathSuffixFilter.create(paths[i]); return filters; }
treeWalk.addTree(tree); treeWalk.setFilter(AndTreeFilter .create(PathFilter.create(testDefinitionsDirectory), PathSuffixFilter.create("definition.json"))); treeWalk.setRecursive(true);
/** * Create a new tree filter for a user supplied path suffix. * <p> * Path strings use '/' to delimit directories on all platforms. * * @param path * the path suffix to filter on. Must not be the empty string. * @return a new filter for the requested path. * @throws java.lang.IllegalArgumentException * the path supplied was the empty string. */ public static PathSuffixFilter create(String path) { if (path.length() == 0) throw new IllegalArgumentException(JGitText.get().emptyPathNotPermitted); return new PathSuffixFilter(path); }
treeWalk.addTree(tree); treeWalk.setFilter(AndTreeFilter .create(PathFilter.create(testDefinitionsDirectory), PathSuffixFilter.create("definition.json"))); treeWalk.setRecursive(true);
/** * Create a new tree filter for a user supplied path suffix. * <p> * Path strings use '/' to delimit directories on all platforms. * * @param path * the path suffix to filter on. Must not be the empty string. * @return a new filter for the requested path. * @throws IllegalArgumentException * the path supplied was the empty string. */ public static PathSuffixFilter create(String path) { if (path.length() == 0) throw new IllegalArgumentException(JGitText.get().emptyPathNotPermitted); return new PathSuffixFilter(path); }