Examples of UriPath


Examples of org.apache.slide.common.UriPath

     *
     * @return   a String
     *
     */
    private String lastUriSegment( String uri ) {
        return new UriPath(uri).lastSegment();
    }
View Full Code Here

Examples of org.apache.slide.common.UriPath

            ObjectNode s = new SubjectNode(c);
            s.setUuri( s.getUri() );
            addBinding( lastUriSegment(c), s );
        }
        ObjectNode p = null;
        UriPath up = new UriPath(uri);
        UriPath pup = up.parent();
        if (pup != null) {
            String pUri = pup.toString();
            p = new SubjectNode( pUri );
            p.setUuri( p.getUri() );
        }
        addParentBinding( getPath().lastSegment(), p );
    }
View Full Code Here

Examples of org.apache.slide.common.UriPath

    public Namespace getNamespace() {
        return super.getNamespace();
    }
   
    public boolean isStoreRoot() {
        UriPath thisPath = new UriPath(uuri);
        UriPath scopePath = new UriPath(scope.toString());
        return thisPath.equals(scopePath);
    }
View Full Code Here

Examples of org.apache.slide.common.UriPath

        Enumeration parentBindings = objectNode.enumerateParentBindings();
        while (parentBindings.hasMoreElements()) {
            ObjectNode.Binding parentBinding = (ObjectNode.Binding) parentBindings.nextElement();
            Element parentElm = new Element("parent", NodeProperty.NamespaceCache.DEFAULT_NAMESPACE);
            Element hrefElm = new Element("href", NodeProperty.NamespaceCache.DEFAULT_NAMESPACE);
            String parentUriStr = new UriPath(objectNode.getUri()).parent().toString();
            Uri parentUri = new Uri(uri.getToken(), uri.getNamespace(), parentUriStr);
            String uriStr;
            if (useBinding) {
                ResourceId parentResourceId = ResourceId.create(parentUri, parentBinding.getUuri());
                uriStr = getFirstMapping(parentResourceId);
View Full Code Here

Examples of org.apache.slide.common.UriPath

    private ObjectNode doResolve(Uri uri) throws ObjectNotFoundException, ServiceAccessException {
        // check resolve cache first
        ResourceId resourceId = checkResolveCache(uri);
       
        if (resourceId == null) {
            UriPath uriPath = new UriPath(uri.toString());
            String[] segments = uriPath.tokens();
            String rootUriStr = uri.getScope().toString();
            if (!"/".equals(rootUriStr)) {
                rootUriStr += "/";
            }
            String currentUriStr = rootUriStr;
            Uri currentUri = new Uri(uri.getToken(), uri.getNamespace(), currentUriStr);
            ResourceId currentResourceId = ResourceId.create(currentUri, currentUriStr);
            int start = new UriPath(rootUriStr).tokens().length;
           
            for (int i = start; i < segments.length; i++) {
                // cacheResolve(currentUri, currentResourceId);
                // TODO: make it work with caching here :-(
               
                ObjectNode objectNode = currentResourceId.getStore().retrieveObject(currentResourceId);
                objectNode.setUri(currentUriStr);
                currentUriStr = uriPath.subUriPath(0, i + 1).toString();
                currentUri = new Uri(uri.getToken(), uri.getNamespace(), currentUriStr);
                String currentUuri = objectNode.getBindingUuri(segments[i]);
                if (currentUuri == null) {
                    throw new ObjectNotFoundException(currentUriStr);
                }
View Full Code Here

Examples of org.apache.slide.common.UriPath

                // NodeRevisionDescriptor object
                isCollection = true;
                revisionDescriptor = new NodeRevisionDescriptor(0);
               
                if (!Configuration.useBinding(token.getUri(lightSToken, object.getUri()).getStore())) {
                    revisionDescriptor.setName(new UriPath(object.getUri()).lastSegment());
                }
               
                hrefElement.setText(
                    WebdavUtils.getAbsolutePath(object.getUri(), req,
                                                getConfig()));
View Full Code Here

Examples of org.apache.slide.common.UriPath

        Enumeration parentBindings = objectNode.enumerateParentBindings();
        while (parentBindings.hasMoreElements()) {
            ObjectNode.Binding parentBinding = (ObjectNode.Binding) parentBindings.nextElement();
            Element parentElm = new Element("parent", NodeProperty.NamespaceCache.DEFAULT_NAMESPACE);
            Element hrefElm = new Element("href", NodeProperty.NamespaceCache.DEFAULT_NAMESPACE);
            String parentUriStr = new UriPath(objectNode.getUri()).parent().toString();
            Uri parentUri = new Uri(uri.getToken(), uri.getNamespace(), parentUriStr);
            String uriStr;
            if (useBinding) {
                ResourceId parentResourceId = ResourceId.create(parentUri, parentBinding.getUuri());
                uriStr = getOneUri(parentResourceId);
View Full Code Here

Examples of org.apache.slide.common.UriPath

    private ObjectNode doResolve(Uri uri, int lockType, int parentLockType) throws TLockedException, ObjectNotFoundException, ServiceAccessException {
        // check resolve cache first
        ResourceId resourceId = checkResolveCache(uri);
       
        if (resourceId == null) {
            UriPath uriPath = new UriPath(uri.toString());
            String[] segments = uriPath.tokens();
            String rootUriStr = uri.getScope().toString();
            String currentUriStr = rootUriStr;
            Uri currentUri = new Uri(uri.getToken(), uri.getNamespace(), currentUriStr);
            ResourceId currentResourceId = ResourceId.create(currentUri, currentUriStr);
            int start = new UriPath(rootUriStr).tokens().length;

            for (int i = start; i < segments.length; i++) {
                tlockManager.lock(currentResourceId, currentUriStr, parentLockType);
                // cacheResolve(currentUri, currentResourceId);
                // TODO: make it work with caching here :-(
               
                // call super such that e.g. caching can take place
                ObjectNode objectNode = super.retrieveObject(currentResourceId);
                currentUriStr = uriPath.subUriPath(0, i + 1).toString();
                currentUri = new Uri(uri.getToken(), uri.getNamespace(), currentUriStr);
                String currentUuri = objectNode.getBindingUuri(segments[i]);
                if (currentUuri == null) {
                    throw new ObjectNotFoundException(currentUriStr);
                }
View Full Code Here

Examples of org.apache.slide.common.UriPath

        // call super such that e.g. caching can take place
        return super.retrieveObject(resourceId);
    }
   
    private void doTLock(Uri uri, ResourceId resourceId, int lockType, int parentLockType) throws TLockedException, ObjectNotFoundException, ServiceAccessException {
        UriPath uriPath = new UriPath(uri.toString());
        String[] segments = uriPath.tokens();
        int start = new UriPath(uri.getScope().toString()).tokens().length;
       
        for (int i = start; i < segments.length; i++) {
            String currentUriStr = uriPath.subUriPath(0, i).toString();
            Uri currentUri = new Uri(uri.getToken(), uri.getNamespace(), currentUriStr);
//            ResourceId currentResourceId = obtainResourceId(currentUri);
            ResourceId currentResourceId = checkResolveCache(currentUri);
            if (currentResourceId == null) {
                currentResourceId = obtainResourceId(currentUri);
View Full Code Here

Examples of org.apache.slide.common.UriPath

            // Set the creation user
            setCreationUser(token, revisionDescriptor);
        }
        // set the display name (in case of copy)
        if (!Configuration.useBinding(namespace.getUri(token, strUri).getStore())) {
            revisionDescriptor.setName(new UriPath(strUri).lastSegment());
        }
       
        Uri objectUri = namespace.getUri(token, strUri);
       
        NodeRevisionDescriptors revisionDescriptors = null;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.