Refine search
@Nonnull private Iterator<String> getMixinTypeNames(@Nonnull Tree tree) throws RepositoryException { Iterator<String> mixinNames = Collections.emptyIterator(); if (tree.hasProperty(JcrConstants.JCR_MIXINTYPES) || canReadProperty(tree, JcrConstants.JCR_MIXINTYPES)) { mixinNames = TreeUtil.getNames(tree, JcrConstants.JCR_MIXINTYPES).iterator(); } else if (tree.getStatus() != Status.NEW) { // OAK-2441: for backwards compatibility with Jackrabbit 2.x try to // read the primary type from the underlying node state. mixinNames = TreeUtil.getNames( RootFactory.createReadOnlyRoot(sessionDelegate.getRoot()).getTree(tree.getPath()), JcrConstants.JCR_MIXINTYPES).iterator(); } return mixinNames; }
@CheckForNull private String getPrimaryTypeName(@Nonnull Tree tree) { String primaryTypeName = null; if (tree.hasProperty(JcrConstants.JCR_PRIMARYTYPE)) { primaryTypeName = TreeUtil.getPrimaryTypeName(tree); } else if (tree.getStatus() != Status.NEW) { // OAK-2441: for backwards compatibility with Jackrabbit 2.x try to // read the primary type from the underlying node state. primaryTypeName = TreeUtil.getPrimaryTypeName(RootFactory.createReadOnlyRoot(sessionDelegate.getRoot()).getTree(tree.getPath())); } return primaryTypeName; }
@Nonnull protected Tree getTree(@Nullable String oakPath, long permissions, boolean checkAcContent) throws RepositoryException { Tree tree = (oakPath == null) ? root.getTree("/") : root.getTree(oakPath); if (!tree.exists()) { throw new PathNotFoundException("No tree at " + oakPath); } if (permissions != Permissions.NO_PERMISSION) { // check permissions checkPermissions((oakPath == null) ? null : tree, permissions); } // check if the tree defines access controlled content if (checkAcContent && config.getContext().definesTree(tree)) { throw new AccessControlException("Tree " + tree.getPath() + " defines access control content."); } return tree; }
private Validator visibleValidator(@Nonnull Tree source, @Nonnull Tree dest) { // TODO improve: avoid calculating the 'before' permissions in case the current parent permissions already point to the correct tree. ImmutableTree immutableTree = (ImmutableTree) moveCtx.rootBefore.getTree("/"); TreePermission tp = getPermissionProvider().getTreePermission(immutableTree , TreePermission.EMPTY); for (String n : PathUtils.elements(source.getPath())) { immutableTree = immutableTree.getChild(n); tp = tp.getChildPermission(n, immutableTree.getNodeState()); } Validator validator = createValidator(source, dest, tp, this); return new VisibleValidator(validator, true, false); }
@NotNull private Iterator<String> getMixinTypeNames(@NotNull Tree tree) throws RepositoryException { Iterator<String> mixinNames = Collections.emptyIterator(); if (tree.hasProperty(JcrConstants.JCR_MIXINTYPES) || canReadMixinTypes(tree)) { mixinNames = TreeUtil.getNames(tree, JcrConstants.JCR_MIXINTYPES).iterator(); } else if (tree.getStatus() != Status.NEW) { // OAK-2441: for backwards compatibility with Jackrabbit 2.x try to // read the primary type from the underlying node state. mixinNames = TreeUtil.getNames( RootFactory.createReadOnlyRoot(sessionDelegate.getRoot()).getTree(tree.getPath()), JcrConstants.JCR_MIXINTYPES).iterator(); } return mixinNames; }
@Nonnull private Tree getExistingBaseVersion(@Nonnull Tree versionableTree) throws RepositoryException { Tree baseVersion = getBaseVersion(versionableTree); if (baseVersion == null) { throw new IllegalStateException("Base version does not exist for " + versionableTree.getPath()); } return baseVersion; } }
@NotNull private Iterator<String> getMixinTypeNames(@NotNull Tree tree) throws RepositoryException { Iterator<String> mixinNames = Collections.emptyIterator(); if (tree.hasProperty(JcrConstants.JCR_MIXINTYPES) || canReadMixinTypes(tree)) { mixinNames = TreeUtil.getNames(tree, JcrConstants.JCR_MIXINTYPES).iterator(); } else if (tree.getStatus() != Status.NEW) { // OAK-2441: for backwards compatibility with Jackrabbit 2.x try to // read the primary type from the underlying node state. mixinNames = TreeUtil.getNames( RootFactory.createReadOnlyRoot(sessionDelegate.getRoot()).getTree(tree.getPath()), JcrConstants.JCR_MIXINTYPES).iterator(); } return mixinNames; }