private static boolean isMerge(String path, Set<String> mergePaths) { for (String mergePath : mergePaths) { if (PathUtils.isAncestor(mergePath, path) || mergePath.equals(path)) { return true; } } return false; }
private static boolean isMerge(String path, Set<String> mergePaths) { for (String mergePath : mergePaths) { if (PathUtils.isAncestor(mergePath, path) || mergePath.equals(path)) { return true; } } return false; }
private static boolean isMerge(String path, Set<String> mergePaths) { for (String mergePath : mergePaths) { if (PathUtils.isAncestor(mergePath, path) || mergePath.equals(path)) { return true; } } return false; }
private boolean expectAuthorizableFolder(final String path) { return !PathUtils.denotesRoot(path) && (PathUtils.isAncestor(path, groupsPath) || path.equals(groupsPath) || PathUtils.isAncestor(path, usersPath) || path.equals(usersPath)); }
/** * Utility method to check whether any of the provided {@code paths} is a descendant * of the given ancestor path. * * @param ancestor Ancestor path * @param paths Paths that may be descendants of {@code ancestor}. * @return true if {@code paths} contains a descendant of {@code ancestor}, false otherwise. */ private static boolean isAncestorOfAnyPath(@NotNull final String ancestor, @NotNull final Set<String> paths) { for (final String p : paths) { if (PathUtils.isAncestor(ancestor, p)) { return true; } } return false; }
/** * Utility method to check whether any of the provided {@code paths} is a descendant * of the given ancestor path. * * @param ancestor Ancestor path * @param paths Paths that may be descendants of {@code ancestor}. * @return true if {@code paths} contains a descendant of {@code ancestor}, false otherwise. */ private static boolean isAncestorOfAnyPath(@Nonnull final String ancestor, @Nonnull final Set<String> paths) { for (final String p : paths) { if (PathUtils.isAncestor(ancestor, p)) { return true; } } return false; }
private boolean expectAuthorizableFolder(final String path) { return !PathUtils.denotesRoot(path) && (PathUtils.isAncestor(path, groupsPath) || path.equals(groupsPath) || PathUtils.isAncestor(path, usersPath) || path.equals(usersPath)); }
@Override public boolean isUnder(String path) { path = SANITIZE_PATH.apply(path); String nextPath = includedPaths.higher(path); return nextPath != null && isAncestor(path, nextPath); }
@Override public boolean isUnder(String path) { path = SANITIZE_PATH.apply(path); String nextPath = includedPaths.higher(path); return nextPath != null && isAncestor(path, nextPath); }
@Override public boolean isMounted(String path) { if (path.contains(pathFragmentName)) { String parent = path.substring(0, path.indexOf(pathFragmentName)); parent = parent.substring(0, parent.lastIndexOf('/')); if (isSupportFragment(parent)) { return true; } } path = SANITIZE_PATH.apply(path); String previousPath = includedPaths.floor(path); return previousPath != null && (previousPath.equals(path) || isAncestor(previousPath, path)); }
@Override public boolean isMounted(String path) { if (path.contains(pathFragmentName)) { String parent = path.substring(0, path.indexOf(pathFragmentName)); parent = parent.substring(0, parent.lastIndexOf('/')); if (isSupportFragment(parent)) { return true; } } path = SANITIZE_PATH.apply(path); String previousPath = includedPaths.floor(path); return previousPath != null && (previousPath.equals(path) || isAncestor(previousPath, path)); }
private boolean checkForQueryPaths() { String[] queryPaths = definition.getQueryPaths(); if (queryPaths == null){ //No explicit value specified. Assume '/' which results in true return true; } String pathRestriction = filter.getPath(); for (String queryPath : queryPaths){ if (queryPath.equals(pathRestriction) || PathUtils.isAncestor(queryPath, pathRestriction)){ return true; } } return false; }
@Override public boolean evaluate() { String a = ancestorSelector.currentPath(); String d = descendantSelector.currentPath(); return PathUtils.isAncestor(a, d); }
@Override public boolean evaluate() { String a = ancestorSelector.currentPath(); String d = descendantSelector.currentPath(); return PathUtils.isAncestor(a, d); }
@Override public boolean evaluate() { String a = ancestorSelector.currentPath(); String d = descendantSelector.currentPath(); return PathUtils.isAncestor(a, d); }
protected static boolean shouldInclude(String docPath, IndexPlan plan) { String path = getPathRestriction(plan); boolean include = true; Filter filter = plan.getFilter(); switch (filter.getPathRestriction()) { case EXACT: include = path.equals(docPath); break; case DIRECT_CHILDREN: include = PathUtils.getParentPath(docPath).equals(path); break; case ALL_CHILDREN: include = PathUtils.isAncestor(path, docPath); break; } return include; }
@Override public boolean onEvent(Event event) throws Exception { return PathUtils.isAncestor(path, event.getPath()); } });
@Override public boolean evaluate() { if (selector.isVirtualRow()) { return true; } String p = selector.currentPath(); if (p == null) { return false; } String path = normalizePath(ancestorPath); if (path == null) { return false; } return PathUtils.isAncestor(path, p); }
@Override public boolean evaluate() { if (selector.isVirtualRow()) { return true; } String p = selector.currentPath(); if (p == null) { return false; } String path = normalizePath(ancestorPath); if (path == null) { return false; } return PathUtils.isAncestor(path, p); }
@Override public boolean evaluate() { if (selector.isVirtualRow()) { return true; } String p = selector.currentPath(); if (p == null) { return false; } String path = normalizePath(ancestorPath); if (path == null) { return false; } return PathUtils.isAncestor(path, p); }