Examples of MultiStatus


Examples of org.apache.jackrabbit.webdav.MultiStatus

        int depth = request.getDepth(DEPTH_INFINITY);
        DavPropertyNameSet requestProperties = request.getPropFindProperties();
        int propfindType = request.getPropFindType();

        MultiStatus mstatus = new MultiStatus();
        mstatus.addResourceProperties(resource, requestProperties, propfindType, depth);
        response.sendMultiStatus(mstatus);
    }
View Full Code Here

Examples of org.apache.jackrabbit.webdav.MultiStatus

        if (setProperties.isEmpty() && removeProperties.isEmpty()) {
            response.sendError(DavServletResponse.SC_BAD_REQUEST);
            return;
        }

        MultiStatus ms = new MultiStatus();
        try {
            MultiStatusResponse msr = resource.alterProperties(setProperties, removeProperties);
            ms.addResponse(msr);
        } catch (DavException e) {
            /* NOTE: known bug with litmus, which expects the exception (e.g. 423)
               to the set instead of the MultiStatus Code. RFC 2518 explicitely
               expects the errors to be included in the multistatus.
               Remove the catch if this turns out to be an problem with clients
               in general. */
            ms.addResourceStatus(resource, e.getErrorCode(), DEPTH_0);
        }
        response.sendMultiStatus(ms);
    }
View Full Code Here

Examples of org.apache.jackrabbit.webdav.MultiStatus

        if (!(resource instanceof VersionControlledResource)) {
            response.sendError(DavServletResponse.SC_METHOD_NOT_ALLOWED);
            return;
        }
        MergeInfo info = request.getMergeInfo();
        MultiStatus ms = ((VersionControlledResource) resource).merge(info);
        response.sendMultiStatus(ms);
    }
View Full Code Here

Examples of org.apache.jackrabbit.webdav.MultiStatus

        if (!(resource instanceof VersionControlledResource)) {
            response.sendError(DavServletResponse.SC_METHOD_NOT_ALLOWED);
            return;
        }
        UpdateInfo info = request.getUpdateInfo();
        MultiStatus ms = ((VersionControlledResource) resource).update(info);
        response.sendMultiStatus(ms);
    }
View Full Code Here

Examples of org.apache.jackrabbit.webdav.MultiStatus

        }
        if (!exists()) {
            throw new DavException(DavServletResponse.SC_NOT_FOUND);
        }

        MultiStatus ms = new MultiStatus();
        try {
            Node node = (Node)item;
            Element udElem = updateInfo.getUpdateElement();
            boolean removeExisting = DomUtil.hasChildElement(udElem, XML_REMOVEEXISTING, NAMESPACE);
View Full Code Here

Examples of org.apache.jackrabbit.webdav.MultiStatus

        }
        if (!exists()) {
            throw new DavException(DavServletResponse.SC_NOT_FOUND);
        }

        MultiStatus ms = new MultiStatus();
        try {
            Node node = (Node)item;

            // register eventListener in order to be able to report all
            // modified resources.
            EventListener el = new EListener(mergeInfo.getPropertyNameSet(), ms);
            registerEventListener(el, node.getPath());

            // todo: RFC allows multiple href elements inside the DAV:source element
            String workspaceName = getLocatorFromHref(mergeInfo.getSourceHrefs()[0]).getWorkspaceName();
            NodeIterator failed = node.merge(workspaceName, !mergeInfo.isNoAutoMerge());

            // unregister the event listener again
            unregisterEventListener(el);

            // add resources to the multistatus, that failed to be merged
            while (failed.hasNext()) {
                Node failedNode = failed.nextNode();
                DavResourceLocator loc = getLocatorFromItem(failedNode);
                DavResource res = createResourceFromLocator(loc);
                ms.addResponse(new MultiStatusResponse(res, mergeInfo.getPropertyNameSet()));
            }

        } catch (RepositoryException e) {
            throw new JcrDavException(e);
        }
View Full Code Here

Examples of org.apache.jackrabbit.webdav.MultiStatus

     * Webdav compatible form.
     * @throws RepositoryException
     */
    private MultiStatus queryResultToMultiStatus(QueryResult qResult)
            throws RepositoryException {
        MultiStatus ms = new MultiStatus();

        String[] columnNames = qResult.getColumnNames();
        RowIterator rowIter = qResult.getRows();
        while (rowIter.hasNext()) {
            Row row = rowIter.nextRow();
            Value[] values = row.getValues();

            // get the jcr:path column indicating the node path and build
            // a webdav compliant resource path of it.
            String itemPath = row.getValue(JcrConstants.JCR_PATH).getString();
            // create a new ms-response for this row of the result set
            DavResourceLocator loc = locator.getFactory().createResourceLocator(locator.getPrefix(), locator.getWorkspacePath(), itemPath, false);
            String href = loc.getHref(true);
            MultiStatusResponse resp = new MultiStatusResponse(href, null);
            // build the s-r-property
            SearchResultProperty srp = new SearchResultProperty(columnNames, values);
            resp.add(srp);
            ms.addResponse(resp);
        }
        return ms;
    }
View Full Code Here

Examples of org.apache.jackrabbit.webdav.MultiStatus

            String uuid = DomUtil.getTextTrim(hrefElem);
            DavResourceLocator resourceLoc = resource.getLocator();
            Node n = getRepositorySession().getNodeByUUID(uuid);
            DavResourceLocator loc = resourceLoc.getFactory().createResourceLocator(resourceLoc.getPrefix(), resourceLoc.getWorkspacePath(), n.getPath(), false);
            DavResource locatedResource = resource.getFactory().createResource(loc, resource.getSession());
            ms = new MultiStatus();
            ms.addResourceProperties(locatedResource, info.getPropertyNameSet(), info.getDepth());
        } catch (RepositoryException e) {
            throw new JcrDavException(e);
        }
    }
View Full Code Here

Examples of org.apache.wink.webdav.model.Multistatus

        } else {
            propfind = Propfind.unmarshal(new StringReader(propfindXml));
        }

        // make the response
        Multistatus multistatus = new Multistatus();

        // fill the multistatus object with the response
        addResponseToMultistatus(multistatus, propfind, entry, handler);

        // HTTP response
View Full Code Here

Examples of org.apache.wink.webdav.model.Multistatus

        } else {
            propfind = Propfind.unmarshal(new StringReader(propfindXml));
        }

        // make the response
        Multistatus multistatus = new Multistatus();

        // root collection
        addResponseToMultistatus(multistatus, propfind, feed, provider);

        // sub-collections and entries
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.