Examples of UriPath


Examples of org.apache.slide.common.UriPath

        if (actionUri == ActionNode.ALL_URI) {
            Element allElm = new Element(E_ALL, DNSP);
            privilegeElm.addContent(allElm);
        }
        else {
            Element actionElm = new Element(new UriPath(actionUri).lastSegment(), DNSP);
            privilegeElm.addContent(actionElm);
        }
        return privilegeElm;
    }
View Full Code Here

Examples of org.apache.slide.common.UriPath

                // NodeRevisionDescriptor object
                isCollection = true;
                revisionDescriptor = new NodeRevisionDescriptor(0);
               
                if (!Configuration.useBinding(nsaToken.getUri(sToken, uri).getStore())) {
                    revisionDescriptor.setName(new UriPath(uri).lastSegment());
                }
            }
           
        } catch (AccessDeniedException e) {
            if (revisionDescriptor == null) {
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

                                         WebdavStatus.SC_BAD_REQUEST,
                                         "This report is only defined for depth=0."),
                resourcePath
            );
        }
        UriPath resourcepath = new UriPath(resourcePath);
        NamespaceConfig namespaceConfig = token.getNamespaceConfig();
        UriPath userspath = namespaceConfig.getUsersPath() != null
            ? new UriPath(namespaceConfig.getUsersPath())
            : null;
        UriPath groupspath = namespaceConfig.getGroupsPath() != null
            ? new UriPath(namespaceConfig.getGroupsPath())
            : null;
        UriPath rolespath = namespaceConfig.getRolesPath() != null
            ? new UriPath(namespaceConfig.getRolesPath())
            : null;
        if (!resourcepath.equals(userspath) &&
            !resourcepath.equals(groupspath) &&
            !resourcepath.equals(rolespath)) {
            throw new PreconditionViolationException(
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

            catch (org.apache.slide.content.RevisionDescriptorNotFoundException e) {
                // The object doesn't have any revision, we create a dummy
                // NodeRevisionDescriptor object
                // isCollection = true;
                revisionDescriptor = new NodeRevisionDescriptor(0);
                revisionDescriptor.setName(new UriPath(objectNode.getUri()).lastSegment());
            }
        }
        catch (AccessDeniedException e) {
            e.fillInStackTrace();
            throw e;
View Full Code Here

Examples of org.apache.slide.common.UriPath

            setCreationUser(token, revisionDescriptor);
        }
        // set the display name (in case of copy)
        if (!Configuration.useBinding(namespace.getUri(token, strUri).getStore())) {
            if (revisionDescriptor.getName() == null || revisionDescriptor.getName().length() == 0) {
                revisionDescriptor.setName(new UriPath(strUri).lastSegment());
            }
        }
       
        Uri objectUri = namespace.getUri(token, strUri);
       
View Full Code Here

Examples of org.apache.slide.common.UriPath

            revisionDescriptor.setDefaultProperties(defaultProperties);
        }
        if (namespaceConfig.isPrincipal(associatedObject.getUri())) {
            // principals must have DAV:displayname
            if (revisionDescriptor.getName() == null || revisionDescriptor.getName().length() == 0) {
                UriPath uripath = new UriPath(associatedObject.getUri());
                revisionDescriptor.setName(uripath.lastSegment());
            }
            // principals must have DAV:principal in resourcetype
            String rt = revisionDescriptor.getResourceType();
            if (rt.indexOf("principal") < 0) {
                revisionDescriptor.setResourceType(rt+"<principal/>");
View Full Code Here

Examples of org.apache.slide.common.UriPath

        if (namespaceConfig.getCreateObjectAction() == ActionNode.DEFAULT) {
            // do not check during start-up
            return;
        }
       
        String parentUri = String.valueOf(new UriPath(strUri).parent());
        try {
            NodeRevisionDescriptor parentNrd =
                retrieve(token, retrieve(token, parentUri));
            if (isLockNull(parentNrd)) {
                throw new ObjectNotFoundException(parentUri);
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.