private ReadOnlyNodeTypeManager getManager() { final Tree types = definition.getParent(); return new ReadOnlyNodeTypeManager() { @Override @Nullable protected Tree getTypes() { return types; } }; }
private ReadOnlyNodeTypeManager getManager() { final Tree types = definition.getParent(); return new ReadOnlyNodeTypeManager() { @Override @Nullable protected Tree getTypes() { return types; } }; }
private ReadOnlyNodeTypeManager getManager() { final Tree types = definition.getParent(); return new ReadOnlyNodeTypeManager() { @Override @CheckForNull protected Tree getTypes() { return types; } }; }
@NotNull @Override public TreeLocation getParent() { return tree.isRoot() ? NullLocation.NULL : new NodeLocation(tree.getParent()); }
@Nonnull @Override public TreeLocation getParent() { return tree.isRoot() ? NullLocation.NULL : new NodeLocation(tree.getParent()); }
@Nullable private Tree findLock(@NotNull Tree tree, boolean deep) { if (holdsLock(tree, deep)) { return tree; } else if (tree.isRoot()) { return null; } else { return findLock(tree.getParent(), true); } }
private void validateTokensParent(@NotNull Tree tokensParent) throws CommitFailedException { verifyHierarchy(tokensParent.getPath()); Tree userTree = tokensParent.getParent(); if (!UserConstants.NT_REP_USER.equals(TreeUtil.getPrimaryTypeName(userTree))) { throw constraintViolation(68, "Invalid location of .tokens node."); } String nt = TreeUtil.getPrimaryTypeName(tokensParent); if (!TOKENS_NT_NAME.equals(nt)) { log.debug("Unexpected node type of .tokens node " + nt + '.'); } } }
@Nullable private Tree findLock(@NotNull Tree tree, boolean deep) { if (holdsLock(tree, deep)) { return tree; } else if (tree.isRoot()) { return null; } else { return findLock(tree.getParent(), true); } }
@CheckForNull private Tree findLock(@Nonnull Tree tree, boolean deep) { if (holdsLock(tree, deep)) { return tree; } else if (tree.isRoot()) { return null; } else { return findLock(tree.getParent(), true); } }
private TreeType internalGetType(@NotNull Tree tree) { Tree t = tree; while (!t.isRoot()) { TreeType type = internalGetType(t.getName(), t); // stop walking up the hierarchy as soon as a special type is found if (TreeType.DEFAULT != type) { return type; } t = t.getParent(); } return TreeType.DEFAULT; }
private TreeType internalGetType(@Nonnull Tree tree) { Tree t = tree; while (!t.isRoot()) { TreeType type = internalGetType(t.getName(), t); // stop walking up the hierarchy as soon as a special type is found if (TreeType.DEFAULT != type) { return type; } t = t.getParent(); } return TreeType.DEFAULT; }
private NodeDefinition getDefinition(Tree tree) throws RepositoryException { if (tree.isRoot()) { return definitionProvider.getRootDefinition(); } else { return definitionProvider.getDefinition(tree.getParent(), tree); } }
private NodeDefinition getDefinition(Tree tree) throws RepositoryException { if (tree.isRoot()) { return definitionProvider.getRootDefinition(); } else { return definitionProvider.getDefinition(tree.getParent(), tree); } }
private void checkValidAccessControlEntry(@NotNull Tree aceNode) throws CommitFailedException { Tree parent = aceNode.getParent(); if (!parent.exists() || !NT_REP_ACL.equals(TreeUtil.getPrimaryTypeName(parent))) { throw accessViolation(7, "Isolated access control entry at " + aceNode.getPath()); } checkValidPrincipal(aceNode); checkValidPrivileges(aceNode); checkValidRestrictions(aceNode); }
private void checkValidAccessControlEntry(@Nonnull Tree aceNode) throws CommitFailedException { Tree parent = aceNode.getParent(); if (!parent.exists() || !NT_REP_ACL.equals(TreeUtil.getPrimaryTypeName(parent))) { throw accessViolation(7, "Isolated access control entry at " + aceNode.getPath()); } checkValidPrincipal(aceNode); checkValidPrivileges(aceNode); checkValidRestrictions(aceNode); }
private void checkValidAccessControlEntry(@NotNull Tree aceNode) throws CommitFailedException { Tree parent = aceNode.getParent(); if (!parent.exists() || !NT_REP_ACL.equals(TreeUtil.getPrimaryTypeName(parent))) { throw accessViolation(7, "Isolated access control entry at " + aceNode.getPath()); } checkValidPrincipal(aceNode); checkValidPrivileges(aceNode); checkValidRestrictions(aceNode); }
private TreePermission getTreePermission(@NotNull Tree readOnlyTree) { Tree t = readOnlyTree; while (Utils.isSupportedPath(supportedPath, t.getPath())) { if (t.hasChild(REP_3_ROLES_POLICY)) { return new ThreeRolesTreePermission(getRole(t), ctx.definesContextRoot(t)); } t = t.getParent(); } return TreePermission.EMPTY; }
@Test public void testGetTreeWithParentElements() { String relPath = PathUtils.relativize(PathUtils.ROOT_PATH, child.getPath()) + "/.."; Tree t = TreeUtil.getTree(rootTree, relPath); assertEquals(child.getParent().getPath(), t.getPath()); }
@Test public void testIsVersionStoreTree() throws Exception { assertFalse(ReadOnlyVersionManager.isVersionStoreTree(root.getTree("/"))); assertFalse(ReadOnlyVersionManager.isVersionStoreTree(root.getTree("/a"))); assertFalse(ReadOnlyVersionManager.isVersionStoreTree(root.getTree("/a/b/c"))); assertTrue(ReadOnlyVersionManager.isVersionStoreTree(root.getTree(VersionConstants.VERSION_STORE_PATH))); Tree versionHistory = versionManager.getVersionHistory(root.getTree("/a")); assertNotNull(versionHistory); assertFalse(ReadOnlyVersionManager.isVersionStoreTree(versionHistory)); assertTrue(ReadOnlyVersionManager.isVersionStoreTree(versionHistory.getParent())); }