Package org.apache.jackrabbit.name

Examples of org.apache.jackrabbit.name.Path$PathElement


    protected NodeImpl internalAddNode(String relPath, NodeTypeImpl nodeType,
                                       NodeId id)
            throws ItemExistsException, PathNotFoundException, VersionException,
            ConstraintViolationException, LockException, RepositoryException {
        Path nodePath;
        QName nodeName;
        Path parentPath;
        try {
            nodePath =
                    PathFormat.parse(getPrimaryPath(), relPath,
                            session.getNamespaceResolver()).getCanonicalPath();
            if (nodePath.getNameElement().getIndex() != 0) {
View Full Code Here


    protected NodeImpl internalAddChildNode(QName nodeName,
                                            NodeTypeImpl nodeType, NodeId id)
            throws ItemExistsException, ConstraintViolationException,
            RepositoryException {
        Path nodePath;
        try {
            nodePath = Path.create(getPrimaryPath(), nodeName, true);
        } catch (MalformedPathException e) {
            // should never happen
            String msg = "internal error: invalid path " + safeGetJCRPath();
View Full Code Here

            ConstraintViolationException, ItemNotFoundException, LockException,
            RepositoryException {

        Path.PathElement insertName;
        try {
            Path p = PathFormat.parse(srcName, session.getNamespaceResolver());
            // p must be a relative path of length==depth==1 (to eliminate e.g. "..")
            if (p.isAbsolute() || p.getLength() != 1 || p.getDepth() != 1) {
                throw new RepositoryException("invalid name: " + srcName);
            }
            insertName = p.getNameElement();
        } catch (MalformedPathException e) {
            String msg = "invalid name: " + srcName;
            log.debug(msg);
            throw new RepositoryException(msg, e);
        }

        Path.PathElement beforeName;
        if (destName != null) {
            try {
                Path p = PathFormat.parse(destName, session.getNamespaceResolver());
                // p must be a relative path of length==depth==1 (to eliminate e.g. "..")
                if (p.isAbsolute() || p.getLength() != 1 || p.getDepth() != 1) {
                    throw new RepositoryException("invalid name: " + destName);
                }
                beforeName = p.getNameElement();
            } catch (MalformedPathException e) {
                String msg = "invalid name: " + destName;
                log.debug(msg);
                throw new RepositoryException(msg, e);
            }
View Full Code Here

                return m2.getPath();
            }

            String relPath;
            try {
                Path p = m1.getPrimaryPath().computeRelativePath(getPrimaryPath());
                // use prefix mappings of srcSession
                relPath = PathFormat.format(p, srcSession.getNamespaceResolver());
            } catch (NameException be) {
                // should never get here...
                String msg = "internal error: failed to determine relative path";
View Full Code Here

                // check if versionable node exists
                InternalFrozenNode fn = ((VersionImpl) version).getFrozenNode();
                node = (NodeImpl) session.getNodeByUUID(fn.getFrozenUUID());
                if (removeExisting) {
                    try {
                        Path dstPath = PathFormat.parse(getPrimaryPath(),
                                relPath, session.getNamespaceResolver()).getCanonicalPath();
                        // move to respective location
                        session.move(node.getPath(), PathFormat.format(dstPath, session.getNamespaceResolver()));
                        // need to refetch ?
                        node = (NodeImpl) session.getNodeByUUID(fn.getFrozenUUID());
View Full Code Here

                return m2;
            }

            String relPath;
            try {
                Path p = m1.getPrimaryPath().computeRelativePath(getPrimaryPath());
                // use prefix mappings of srcSession
                relPath = PathFormat.format(p, srcSession.getNamespaceResolver());
            } catch (NameException be) {
                // should never get here...
                String msg = "internal error: failed to determine relative path";
View Full Code Here

     * @param lockToken lock token to apply
     */
    private void reapplyLock(LockToken lockToken) {
        try {
            NodeImpl node = (NodeImpl) session.getItemManager().getItem(lockToken.id);
            Path path = getPath(lockToken.id);

            LockInfo info = new LockInfo(lockToken, false,
                    node.getProperty(QName.JCR_LOCKISDEEP).getBoolean(),
                    node.getProperty(QName.JCR_LOCKOWNER).getString());
            info.setLive(true);
View Full Code Here

        acquire();

        try {
            // check whether node is already locked
            Path path = getPath(node.getId());
            PathMap.Element element = lockMap.map(path, false);

            LockInfo other = (LockInfo) element.get();
            if (other != null) {
                if (element.hasPath(path)) {
View Full Code Here

     */
    public AbstractLockInfo getLockInfo(NodeId id) throws RepositoryException {
        acquire();

        try {
            Path path = getPath(id);

            PathMap.Element element = lockMap.map(path, false);
            AbstractLockInfo info = (AbstractLockInfo) element.get();
            if (info != null) {
                if (element.hasPath(path) || info.deep) {
View Full Code Here

        acquire();

        try {
            SessionImpl session = (SessionImpl) node.getSession();
            Path path = getPath(node.getId());

            PathMap.Element element = lockMap.map(path, false);
            AbstractLockInfo info = (AbstractLockInfo) element.get();
            if (info == null) {
                throw new LockException("Node not locked: " + node.safeGetJCRPath());
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.name.Path$PathElement

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.