Package org.apache.jackrabbit.spi

Examples of org.apache.jackrabbit.spi.Path


            return super.getPrimaryPath();
        }

        NodeId parentId = getParentId();
        NodeImpl parentNode = (NodeImpl) getParent();
        Path parentPath = parentNode.getPrimaryPath();
        PathBuilder builder = new PathBuilder(parentPath);

        ChildNodeEntry entry =
            parentNode.getNodeState().getChildNodeEntry(getNodeId());
        if (entry == null) {
View Full Code Here


        }
    }

    public void testIsGrantedWithRelativePath() throws NotExecutableException {
        AccessManager acMgr = getAccessManager(superuser);
        Path p = PathFactoryImpl.getInstance().create(NameConstants.JCR_DATA);
        try {
            acMgr.isGranted(p, Permission.READ);
            fail("calling AccessManager.isGranted(Path, int) with relative path must fail.");
        } catch (RepositoryException e) {
            // success
View Full Code Here

        }
    }

    public void testIsGrantedPathToNonExistingItem() throws NotExecutableException, RepositoryException {
        AccessManager acMgr = getAccessManager(superuser);
        Path p = PathFactoryImpl.getInstance().getRootPath();

        // existing node-path
        assertTrue(acMgr.isGranted(p, Permission.ALL));
        // not existing property:
        assertTrue(acMgr.isGranted(p, NameConstants.JCR_CREATED, Permission.ALL));
View Full Code Here

    public void testIsGrantedReadOnlySession() throws NotExecutableException, RepositoryException {
        Session s = getHelper().getReadOnlySession();
        try {
            AccessManager acMgr = getAccessManager(s);
            Path p = PathFactoryImpl.getInstance().getRootPath();

            // existing node-path
            assertTrue(acMgr.isGranted(p, Permission.READ));
            // not existing property:
            assertTrue(acMgr.isGranted(p, NameConstants.JCR_CREATED, Permission.READ));
View Full Code Here

            NodeId nId = operation.getNodeId();
            if (nId == null) {
                service.restore(sessionInfo, operation.getVersionIds(), operation.removeExisting());
            } else {
                NodeId targetId;
                Path relPath = operation.getRelativePath();
                if (relPath != null) {
                    targetId = idFactory.createNodeId(nId, relPath);
                } else {
                    targetId = nId;
                }
View Full Code Here

        this.hierarchyMgr = hierarchyMgr;
        if (cacheBehaviour == CacheBehaviour.OBSERVATION) {
            EventFilter filter = null;
            try {
                // listen to all events except 'local' ones
                Path root = wspManager.getPathFactory().getRootPath();
                filter = wspManager.createEventFilter(Event.ALL_TYPES, root, true, null, null, true);
            } catch (RepositoryException e) {
                // spi does not support observation, or another error occurred.
                log.debug("Creating event filter for cache behavoir observation failed", e);
            }
View Full Code Here

                    parent = hierarchyMgr.lookup(parentId);
                    if (parent == null && ev.getPath() != null && parentId.getUniqueID() != null) {
                        // parentID contains a uniqueID part -> try to lookup
                        // the parent by path.
                        try {
                            Path parentPath = ev.getPath().getAncestor(1);
                            parent = hierarchyMgr.lookup(parentPath);
                        } catch (RepositoryException e) {
                            // should not occur
                            log.debug(e.getMessage());
                        }
View Full Code Here

     * Returns the JCR path for the given node state without throwing an exception.
     * @param state node state
     * @return a JCR path string
     */
    protected String safeGetJCRPath(NodeStateEx state) {
        Path path;
        try {
            path = hierMgr.getPath(state.getNodeId());
        } catch (RepositoryException e) {
            log.warn("unable to calculate path for {}", state.getNodeId());
            return state.getNodeId().toString();
        }
        try {
            return session.getJCRPath(path);
        } catch (NamespaceException e) {
            log.warn("unable to calculate path for {}", path);
            return path.toString();
        }
    }
View Full Code Here

        }

        boolean isFull = checkVersionable(state);

        // check permission
        Path path = hierMgr.getPath(state.getNodeId());
        session.getAccessManager().checkPermission(path, Permission.VERSION_MNGMT);

        // 1. The child node and properties of N will be changed, removed or
        //    added to, depending on their corresponding copies in V and their
        //    own OnParentVersion attributes (see 7.2.8, below, for details).
View Full Code Here

    public Item getItem(String absPath) throws PathNotFoundException, RepositoryException {
        // check sanity of this session
        sanityCheck();

        try {
            Path p = getQPath(absPath).getNormalizedPath();
            if (!p.isAbsolute()) {
                throw new RepositoryException("not an absolute path: " + absPath);
            }
            return getItemManager().getItem(p);
        } catch (AccessDeniedException ade) {
            throw new PathNotFoundException(absPath);
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.spi.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.