Package org.apache.jackrabbit.oak.jcr.util

Examples of org.apache.jackrabbit.oak.jcr.util.Path


            if (nodeExists(destination)) {
                throw new ItemExistsException(destination.toJcrPath());
            }

            Path destParentPath = destination.getParent();
            if (!nodeExists(destParentPath)) {
                throw new PathNotFoundException(destParentPath.toJcrPath());
            }

            Path sourcePath = source.getPath();
            NodeDelta moved = source.moveTo(destParentPath, destination.getName());
            notifyMoved(sourcePath, moved);
        }
View Full Code Here


        @Override
        public NodeDelta getNode(String name) {
            NodeDelta delta = getChild(name);
            if (delta == null) {
                Path path = persistentPath.concat(name);
                return nodeExists.evaluate(path)
                        ? existing(this, name, path)
                        : null;
            }
            else {
View Full Code Here

            }
        }
        else if (lt(m.to, n.to)) {  // q < s
            // See 14'.
            if (m.from == NIL) {
                Path p = n.to.getParent();
                if (p.equals(m.to)) {
                    return false;
                }
                else {
                    throw new IllegalArgumentException(m + ", " + n);
                }
View Full Code Here

    }

    //------------------------------------------< internal/private >---

    TransientNodeState getNodeState(NodeDelta nodeDelta) {
        Path path = nodeDelta.getPath();
        TransientNodeState state = cache == null ? null : cache.get(path);
        if (state == null) {
            state = new TransientNodeState(sessionContext, nodeDelta);
            if (cache != null) {
                cache.put(path, state);
View Full Code Here

    private PropertyState getPersistedPropertyState(String name) {
        return getPersistentNodeState().getProperty(name);
    }

    private synchronized NodeState getPersistentNodeState() {
        Path path = getNodeDelta().getPersistentPath();

        return path == null
            ? EmptyNodeState.INSTANCE
            : getPersistentNodeState(sessionContext.getConnection(), path);
    }
View Full Code Here

    /**
     * @see Item#getAncestor(int)
     */
    @Override
    public Item getAncestor(int depth) throws RepositoryException {
        Path parent = path().getAncestor(depth);
        if (parent == null) {
            throw new ItemNotFoundException(path().toJcrPath() + "has no ancestor of depth " + depth);
        }

        return create(sessionContext, parent);
View Full Code Here

     * @see Node#addNode(String)
     */
    @Override
    public Node addNode(String relPath) throws RepositoryException {
        checkStatus();
        Path newPath = path().concat(relPath);
        TransientNodeState parentState = getNodeState(sessionContext, newPath.getParent());
        TransientNodeState childState = parentState.addNode(newPath.getName());
        return create(sessionContext, childState);
    }
View Full Code Here

        return NodeImpl.create(sessionContext, Path.create(sessionContext.getWorkspaceName(), absPath));
    }

    @Override
    public boolean nodeExists(String absPath) throws RepositoryException {
        Path path = Path.create(sessionContext.getWorkspaceName(), absPath);
        return path.isRoot() || NodeImpl.exist(sessionContext, path);
    }
View Full Code Here

        return PropertyImpl.create(sessionContext, Path.create(sessionContext.getWorkspaceName(), absPath));
    }

    @Override
    public boolean propertyExists(String absPath) throws RepositoryException {
        Path path = Path.create(sessionContext.getWorkspaceName(), absPath);
        return !path.isRoot() && PropertyImpl.exist(sessionContext, path);
    }
View Full Code Here

    //------------------------------------------------------------< Writing >---

    @Override
    public void move(String srcAbsPath, String destAbsPath) throws RepositoryException {
        checkIsAlive();
        Path sourcePath = Path.create(sessionContext.getWorkspaceName(), srcAbsPath);
        TransientNodeState sourceParent = nodeStateProvider.getNodeState(sourcePath.getParent());
        if (sourceParent == null) {
            throw new PathNotFoundException(srcAbsPath);
        }

        sourceParent.move(sourcePath.getName(), Path.create(sessionContext.getWorkspaceName(), destAbsPath));
    }
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.oak.jcr.util.Path

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.