Examples of UriHandler


Examples of org.apache.slide.webdav.util.UriHandler

       
        this.versionHistorySet =
            new XMLValue(versionHistorySetElm.getChildren(E_HREF, DNSP));
       
        // check DAV:must-be-version-history
        UriHandler uriHandler = null;
        String href = null;
        boolean isVersionHistory = false;
        Iterator iterator = versionHistorySet.getHrefStrings().iterator();
        while (iterator.hasNext()) {
            href = (String)iterator.next();
            uriHandler = UriHandler.getUriHandler(WebdavUtils.getSlidePath(href, slideContextPath));
            isVersionHistory = uriHandler.isHistoryUri();
            if (!isVersionHistory) {
                break;
            }
        }
        if (!isVersionHistory) {
View Full Code Here

Examples of org.apache.slide.webdav.util.UriHandler

            try {
                XMLValue xmlValue = new XMLValue(property.getValue().toString());
                Iterator iterator = xmlValue.iterator();
                if (iterator.hasNext()) {
                    String vrUri = ((Element)iterator.next()).getText();
                    UriHandler uriHandler = UriHandler.getUriHandler(vrUri);
                    if (uriHandler.isVersionUri()) {
                        historyUri = uriHandler.getAssociatedHistoryUri();
                    }
                }
            }
            catch (JDOMException e) {}
        }
View Full Code Here

Examples of org.apache.slide.webdav.util.UriHandler

        resp.addHeader("MS-Author-Via", "DAV");
       
        // build response body if needed
        if( responseBodyNeeded ) {
            resp.setContentType( TEXT_XML_UTF_8 );
            UriHandler uh = UriHandler.getUriHandler( resourceUri );
            String storeName = uh.getAssociatedBaseStoreName(token.getName());
            UriHandler hpath = HistoryPathHandler.getHistoryPathHandler();
            UriHandler wspath = WorkspacePathHandler.getWorkspacePathHandler();
            Element ore =
                new Element( E_OPTIONS_RESPONSE, DNSP );
            if( versionHistoryCollectionSetRequested ) {
                Element vhcse =
                    new Element( E_VERSION_HISTORY_COLLECTION_SET, DNSP );
View Full Code Here

Examples of org.apache.slide.webdav.util.UriHandler

                throw new SlideException("Could not parse DAV:version-set: "+nrds.getUri());
            }
            Iterator hrefIterator = xmlValue.iterator();
           
            NodeRevisionNumber currentNrn= null;
            UriHandler currentUh = null;
            String currentPath = null;
           
            while (hrefIterator.hasNext()) {
                currentPath = ((Element)hrefIterator.next()).getText();
                currentUh = UriHandler.getUriHandler(currentPath);
                currentNrn = new NodeRevisionNumber(currentUh.getVersionName());
                multistatusElm.addContent(getResponseElement(slideToken, currentPath, currentNrn, getRequestedVersionTreeProperties()));
            }
        }
    }
View Full Code Here

Examples of org.apache.slide.webdav.util.UriHandler

        }
        return false;
    }
   
    private boolean isExcluded(String resourcePath, String excludePath) {
        UriHandler uh = UriHandler.getUriHandler(resourcePath);
        if (excludePath != null && excludePath.length() > 0) {
            UriHandler exUh = UriHandler.getUriHandler(excludePath);
            if (exUh.isAncestorOf(uh)) {
                return true;
            }
        }
        return false;
    }
View Full Code Here

Examples of org.apache.slide.webdav.util.UriHandler

        overwrite = requestHeaders.getOverwrite(true);
    }

    private void checkPreconditions() throws PreconditionViolationException, ServiceAccessException {
        resp.setStatus( WebdavStatus.SC_CREATED );
        UriHandler sourceUh = UriHandler.getUriHandler(sourceUri);
        UriHandler sourceParentUh = sourceUh.getParentUriHandler();
        sourceSegment = sourceUh.getName();
        if (sourceParentUh != null) {
            sourceParentUri = sourceUh.getParentUriHandler().toString();
        }
View Full Code Here

Examples of org.apache.slide.webdav.util.UriHandler

        } else {
            macroParameters = Macro.DEFAULT_PARAMETERS;
        }

        // check destination URI
        UriHandler destinationUriHandler = UriHandler.getUriHandler(destinationUri);
        if (destinationUriHandler.isRestrictedUri()) {
            int statusCode = WebdavStatus.SC_FORBIDDEN;
            sendError( statusCode, getClass().getName()+".restrictedDestinationUri", new Object[]{destinationUri} );
            throw new WebdavException( statusCode );
        }

        UriHandler sourceUriHandler = UriHandler.getUriHandler(sourceUri);
        isRequestSourceWorkspace = sourceUriHandler.isWorkspaceUri();

        try {
            // check preconditions
            ViolatedPrecondition violatedPrecondition = getPreconditionViolation(sourceUri, destinationUri);
            if (violatedPrecondition != null) {
View Full Code Here

Examples of org.apache.slide.webdav.util.UriHandler

        ViolatedPrecondition violatedPrecondition = null;
        if( Configuration.useVersionControl() ) {

            if (isRequestSourceWorkspace) {

                UriHandler destinationUriHandler = UriHandler.getUriHandler(destinationUri);
                NodeRevisionDescriptors destinationRevisionDescriptors = null;
                NodeRevisionDescriptor destinationRevisionDescriptor = null;
                try {
                    destinationRevisionDescriptors = content.retrieve( slideToken, destinationUri);
                    destinationRevisionDescriptor = content.retrieve( slideToken, destinationRevisionDescriptors);
                }
                catch( ObjectNotFoundException e ) {}; // can be ignored here!

                ResourceKind destinationResourceKind =
                    AbstractResourceKind.determineResourceKind( token, destinationUri, destinationRevisionDescriptor );

                if( !(destinationResourceKind instanceof DeltavCompliantUnmappedUrl) ) {
                    return new ViolatedPrecondition(C_RESOURCE_MUST_BE_NULL,
                                                    WebdavStatus.SC_CONFLICT);
                }
                if( !destinationUriHandler.isWorkspaceUri() ) {
                    return new ViolatedPrecondition(C_WORKSPACE_LOCATION_OK,
                                                    WebdavStatus.SC_CONFLICT);
                }
            }
        }
        if (isCollection(sourceUri)) {
            UriHandler destinationUriHandler = UriHandler.getUriHandler(destinationUri);
            ObjectNode destinationParentNode =
                structure.retrieve(slideToken, destinationUriHandler.getParentUriHandler().toString());
            ObjectNode sourceNode =
                structure.retrieve(slideToken, sourceUri);
            if (isDescendant(destinationParentNode, sourceNode)) {
                return new ViolatedPrecondition(C_CYCLE_ALLOWED, WebdavStatus.SC_FORBIDDEN);
            }
View Full Code Here

Examples of org.apache.slide.webdav.util.UriHandler

     */
    public void beforeCopy(String sourceUri, String destinationUri, boolean isRootOfCopy) throws SlideException {

        if( Configuration.useVersionControl() ) {

            UriHandler uriHandler = UriHandler.getUriHandler(sourceUri);
            if (uriHandler.isVersionUri()) {
                throw new PreconditionViolationException(new ViolatedPrecondition(DeltavConstants.C_CANNOT_RENAME_VERSION,
                                                                                  WebdavStatus.SC_FORBIDDEN),
                                                         sourceUri);
            }
            if (uriHandler.isHistoryUri()) {
                throw new PreconditionViolationException(new ViolatedPrecondition(DeltavConstants.C_CANNOT_RENAME_HISTORY,
                                                                                  WebdavStatus.SC_FORBIDDEN),
                                                         sourceUri);
            }
            if (uriHandler.isWorkingresourceUri()) {
                throw new PreconditionViolationException(new ViolatedPrecondition(DeltavConstants.C_CANNOT_RENAME_WORKING_RESOURCE,
                                                                                  WebdavStatus.SC_FORBIDDEN),
                                                         sourceUri);
            }

View Full Code Here

Examples of org.apache.slide.webdav.util.UriHandler

            sendError( statusCode, e );
            throw new WebdavException( statusCode );
        }
       
        try {
            UriHandler rUh = UriHandler.getUriHandler( resourcePath );
            if (isExcludedForVersionControl(resourcePath)) {
                throw new ForbiddenException(
                    resourcePath,
                    new Exception("The resource path has been excluded from version-control") );
            }
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.