本文整理了Java中org.apache.jackrabbit.oak.api.Tree.getParent()
方法的一些代码示例,展示了Tree.getParent()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Tree.getParent()
方法的具体详情如下:
包路径:org.apache.jackrabbit.oak.api.Tree
类名称:Tree
方法名:getParent
暂无
代码示例来源:origin: org.apache.jackrabbit/oak-core
private ReadOnlyNodeTypeManager getManager() {
final Tree types = definition.getParent();
return new ReadOnlyNodeTypeManager() {
@Override @Nullable
protected Tree getTypes() {
return types;
}
};
}
代码示例来源:origin: apache/jackrabbit-oak
private ReadOnlyNodeTypeManager getManager() {
final Tree types = definition.getParent();
return new ReadOnlyNodeTypeManager() {
@Override @Nullable
protected Tree getTypes() {
return types;
}
};
}
代码示例来源:origin: org.apache.sling/org.apache.sling.testing.sling-mock-oak
private ReadOnlyNodeTypeManager getManager() {
final Tree types = definition.getParent();
return new ReadOnlyNodeTypeManager() {
@Override @CheckForNull
protected Tree getTypes() {
return types;
}
};
}
代码示例来源:origin: apache/jackrabbit-oak
@Override
@Nullable
public NodeDelegate getParent() {
return tree.isRoot() || !tree.getParent().exists()
? null
: new NodeDelegate(sessionDelegate, tree.getParent());
}
代码示例来源:origin: apache/jackrabbit-oak
@NotNull
@Override
public TreeLocation getParent() {
return tree.isRoot()
? NullLocation.NULL
: new NodeLocation(tree.getParent());
}
代码示例来源:origin: org.apache.sling/org.apache.sling.testing.sling-mock-oak
@Nonnull
@Override
public TreeLocation getParent() {
return tree.isRoot()
? NullLocation.NULL
: new NodeLocation(tree.getParent());
}
代码示例来源:origin: apache/jackrabbit-oak
@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);
}
}
代码示例来源:origin: org.apache.jackrabbit/oak-core
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 + '.');
}
}
}
代码示例来源:origin: org.apache.jackrabbit/oak-jcr
@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);
}
}
代码示例来源:origin: org.apache.sling/org.apache.sling.testing.sling-mock-oak
@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);
}
}
代码示例来源:origin: apache/jackrabbit-oak
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;
}
代码示例来源:origin: org.apache.sling/org.apache.sling.testing.sling-mock-oak
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;
}
代码示例来源:origin: org.apache.jackrabbit/oak-jcr
private NodeDefinition getDefinition(Tree tree) throws RepositoryException {
if (tree.isRoot()) {
return definitionProvider.getRootDefinition();
} else {
return definitionProvider.getDefinition(tree.getParent(), tree);
}
}
代码示例来源:origin: org.apache.sling/org.apache.sling.testing.sling-mock-oak
private NodeDefinition getDefinition(Tree tree) throws RepositoryException {
if (tree.isRoot()) {
return definitionProvider.getRootDefinition();
} else {
return definitionProvider.getDefinition(tree.getParent(), tree);
}
}
代码示例来源:origin: org.apache.jackrabbit/oak-core
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);
}
代码示例来源:origin: org.apache.sling/org.apache.sling.testing.sling-mock-oak
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);
}
代码示例来源:origin: apache/jackrabbit-oak
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);
}
代码示例来源:origin: apache/jackrabbit-oak
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;
}
代码示例来源:origin: apache/jackrabbit-oak
@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());
}
代码示例来源:origin: apache/jackrabbit-oak
@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()));
}
内容来源于网络,如有侵权,请联系作者删除!