private static String getIndexPath(String path, String indexName) { if (PathUtils.denotesRoot(path)) { return "/" + INDEX_DEFINITIONS_NAME + "/" + indexName; } return path + "/" + INDEX_DEFINITIONS_NAME + "/" + indexName; }
private static String getIndexPath(String path, String indexName) { if (PathUtils.denotesRoot(path)) { return "/" + INDEX_DEFINITIONS_NAME + "/" + indexName; } return path + "/" + INDEX_DEFINITIONS_NAME + "/" + indexName; }
private static boolean inScope(TreeNode node, String path) { if (PathUtils.denotesRoot(path)) { return true; } String p = node.getPath(); return p.startsWith(path) && (p.length() == path.length() || p.charAt(path.length()) == '/'); }
private static boolean inScope(TreeNode node, String path) { if (PathUtils.denotesRoot(path)) { return true; } String p = node.getPath(); return p.startsWith(path) && (p.length() == path.length() || p.charAt(path.length()) == '/'); }
@Override public String getPathPlan() { StringBuilder buff = new StringBuilder(); String p = path; if (PathUtils.denotesRoot(path)) { p = ""; } buff.append(p).append(pathRestriction); if (pathPlan != null) { buff.append(" && ").append(pathPlan); } return buff.toString(); }
private String getPathPrefix(String indexPath) { // 2 = /oak:index/<index name> String parentPath = PathUtils.getAncestorPath(indexPath, 2); return PathUtils.denotesRoot(parentPath) ? "" : parentPath; }
private String getPathPrefix(String indexPath) { // 2 = /oak:index/<index name> String parentPath = PathUtils.getAncestorPath(indexPath, 2); return PathUtils.denotesRoot(parentPath) ? "" : parentPath; }
private void markChanged(String path) { if (!PathUtils.denotesRoot(path) && !PathUtils.isAbsolute(path)) { throw new IllegalArgumentException("path: " + path); } while (true) { changedNodes.add(path); if (PathUtils.denotesRoot(path)) { break; } path = PathUtils.getParentPath(path); } }
private static void addPathsForDiff(String path, Set<String> paths, Iterable<String> modified) { for (String p : modified) { if (PathUtils.denotesRoot(p)) { continue; } String parent = PathUtils.getParentPath(p); if (path.equals(parent)) { paths.add(p); } } }
@NotNull @Override public NodeBuilder builder() { checkState(!denotesRoot(getPath()), "Builder cannot be opened for root " + "path for state of type [%s]", delegate.getClass()); return new MemoryNodeBuilder(this); }
@NotNull @Override public NodeBuilder builder() { checkState(!denotesRoot(getPath()), "Builder cannot be opened for root " + "path for state of type [%s]", delegate.getClass()); return new MemoryNodeBuilder(this); }
private boolean expectAuthorizableFolder(final String path) { return !PathUtils.denotesRoot(path) && (PathUtils.isAncestor(path, groupsPath) || path.equals(groupsPath) || PathUtils.isAncestor(path, usersPath) || path.equals(usersPath)); }
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 @Nullable protected Validator getRootValidator( NodeState before, NodeState after, CommitInfo info) { String path = info.getPath(); if (PathUtils.denotesRoot(path)) { return null; // no need to check saves of the whole transient space } else { return new ItemSaveValidator(path); } }
@Override @CheckForNull protected Validator getRootValidator( NodeState before, NodeState after, CommitInfo info) { String path = info.getPath(); if (PathUtils.denotesRoot(path)) { return null; // no need to check saves of the whole transient space } else { return new ItemSaveValidator(path); } }
@Override public boolean evaluate() { String p = parentSelector.currentPath(); String c = childSelector.currentPath(); // the parent of the root is the root, // so we need to special case this return !PathUtils.denotesRoot(c) && PathUtils.getParentPath(c).equals(p); }
@Override public boolean evaluate() { String p = parentSelector.currentPath(); String c = childSelector.currentPath(); // the parent of the root is the root, // so we need to special case this return !PathUtils.denotesRoot(c) && PathUtils.getParentPath(c).equals(p); }
public MetadataExposingNodeState(AbstractDocumentNodeState documentNodeState) { super(documentNodeState, true); metadataProperties = new ArrayList<>(2); if (PathUtils.denotesRoot(documentNodeState.getPath())) { metadataProperties.add(createProperty(PROP_REVISION, documentNodeState.getRootRevision().asString())); } metadataProperties.add(createProperty(PROP_LAST_REV, documentNodeState.getLastRevision().asString())); }
@Nullable private static Tree getTreeFromLocation(@NotNull TreeLocation location) { Tree tree = (location.getProperty() == null) ? location.getTree() : location.getParent().getTree(); while (tree == null && !PathUtils.denotesRoot(location.getPath())) { location = location.getParent(); tree = location.getTree(); } return tree; }
@Nullable private static Tree getTreeFromLocation(@NotNull TreeLocation location) { Tree tree = (location.getProperty() == null) ? location.getTree() : location.getParent().getTree(); while (tree == null && !PathUtils.denotesRoot(location.getPath())) { location = location.getParent(); tree = location.getTree(); } return tree; }