Package org.apache.jackrabbit.oak.api

Examples of org.apache.jackrabbit.oak.api.TreeLocation


        }
        if (!isVersionable(versionable)) {
            throw new UnsupportedRepositoryOperationException(
                    versionable.getPath() + " is not versionable");
        }
        TreeLocation location = versionable.getLocation();
        if (!isCheckedOut(location)) {
            versionable.setProperty(VersionConstants.JCR_ISCHECKEDOUT,
                    Boolean.TRUE, Type.BOOLEAN);
            try {
                getWorkspaceRoot().commit();
View Full Code Here


            }
        }
    }

    private String findProperty(String path, final String uuid) {
        TreeLocation loc = root.getLocation(path);
        Tree tree = loc.getTree();
        assert tree != null;
        final PropertyState refProp = Iterables.find(tree.getProperties(), new Predicate<PropertyState>() {
            @Override
            public boolean apply(PropertyState pState) {
                if (pState.isArray()) {
View Full Code Here

    private final Tree privilegesTree;

    PrivilegeDefinitionReaderImpl(@Nonnull Tree privilegesTree) {
        if (privilegesTree.isRoot()) {
            TreeLocation location = privilegesTree.getLocation().getChild(JcrConstants.JCR_SYSTEM+'/'+REP_PRIVILEGES);
            this.privilegesTree = checkNotNull(location.getTree());
        } else if (PRIVILEGES_PATH.equals(privilegesTree.getPath())) {
            this.privilegesTree = privilegesTree;
        } else {
            throw new IllegalArgumentException("Illegal privilege tree " + privilegesTree);
        }
View Full Code Here

    @Override
    public Iterator<String> getNames(String relPath) throws RepositoryException {
        checkRelativePath(relPath);

        Tree tree = getTree();
        TreeLocation location = getLocation(tree, relPath);
        Tree parent = location.getTree();
        if (parent != null && Text.isDescendantOrEqual(tree.getPath(), parent.getPath())) {
            List<String> l = new ArrayList<String>();
            for (PropertyState property : parent.getProperties()) {
                String propName = property.getName();
                if (isAuthorizableProperty(tree, location.getChild(propName), false)) {
                    l.add(propName);
                }
            }
            return l.iterator();
        } else {
View Full Code Here

    @Override
    public boolean removeProperty(String relPath) throws RepositoryException {
        checkRelativePath(relPath);

        Tree node = getTree();
        TreeLocation propertyLocation = node.getLocation().getChild(relPath);
        if (propertyLocation.getProperty() != null) {
            if (isAuthorizableProperty(node, propertyLocation, true)) {
                return propertyLocation.remove();
            } else {
                throw new ConstraintViolationException("Property " + relPath + " isn't a modifiable authorizable property");
            }
        }
        // no such property or wasn't a property of this authorizable.
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.oak.api.TreeLocation

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.