Package org.apache.jackrabbit.webdav

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


        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

        DavMethod pFind = new PropFindMethod( uri.toString(), DavConstants.PROPFIND_ALL_PROP, DavConstants.DEPTH_1 );

        executeMethod( username, password, uri, pFind );

        MultiStatus multiStatus = pFind.getResponseBodyAsMultiStatus();
        MultiStatusResponse[] responses = multiStatus.getResponses();
        MultiStatusResponse currResponse;
        System.out.println( "Folders and files in " + filePath + ":" );

        for ( int i = 0; i < responses.length; i++ )
        {
View Full Code Here

            method = new SearchMethod(uri, sInfo);
            getClient(sessionInfo).executeMethod(method);
            method.checkSuccess();

            MultiStatus ms = method.getResponseBodyAsMultiStatus();
            NamePathResolver resolver = getNamePathResolver(sessionInfo);
            return new QueryInfoImpl(ms, idFactory, resolver, valueFactory, getQValueFactory());
        } catch (IOException e) {
            throw new RepositoryException(e);
        } catch (DavException e) {
View Full Code Here

     */
    public MultiStatus search(SearchInfo sInfo) throws DavException {
        try {
            QueryResult result = getQuery(sInfo).execute();

            MultiStatus ms = new MultiStatus();

            if (ItemResourceConstants.NAMESPACE.equals(
                    sInfo.getLanguageNameSpace())) {
                ms.setResponseDescription(
                        "Columns: " + encode(result.getColumnNames())
                        + "\nSelectors: " + encode(result.getSelectorNames()));
            } else {
                ms.setResponseDescription(encode(result.getColumnNames()));
            }

            queryResultToMultiStatus(result, ms);

            return ms;
View Full Code Here

        }
        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

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

        MultiStatus ms = new MultiStatus();
        try {
            // NOTE: RFC requires that all modified resources are reported in the
            // multistatus response. this doesn't work however with the remoting
            // there is no way to distinguish the 'failedId's from any other
            // resources that got modified by this merge operation -> omitted.
           
            // todo: RFC allows multiple href elements inside the DAV:source element
            String workspaceName = getLocatorFromHref(mergeInfo.getSourceHrefs()[0]).getWorkspaceName();

            String depth = DomUtil.getChildTextTrim(mergeInfo.getMergeElement(), DavConstants.XML_DEPTH, DavConstants.NAMESPACE);
            boolean isShallow = "0".equals(depth);

            NodeIterator failed = getVersionManager().merge(item.getPath(), workspaceName, !mergeInfo.isNoAutoMerge(), isShallow);

            // 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

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

        Session session = getRepositorySession();
        MultiStatus ms = new MultiStatus();
        try {
            Element udElem = updateInfo.getUpdateElement();
            boolean removeExisting = DomUtil.hasChildElement(udElem, ItemResourceConstants.XML_REMOVEEXISTING, ItemResourceConstants.NAMESPACE);

            // register eventListener in order to be able to report the modified resources.
View Full Code Here

            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

            method = new SearchMethod(uri, sInfo);
            getClient(sessionInfo).executeMethod(method);
            method.checkSuccess();

            MultiStatus ms = method.getResponseBodyAsMultiStatus();
            NamePathResolver resolver = getNamePathResolver(sessionInfo);
            return new QueryInfoImpl(ms, idFactory, resolver, valueFactory, getQValueFactory());
        } catch (IOException e) {
            throw new RepositoryException(e);
        } catch (DavException e) {
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.webdav.MultiStatus

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.