Java Code Examples for org.apache.jackrabbit.webdav.MultiStatusResponse#add()

The following examples show how to use org.apache.jackrabbit.webdav.MultiStatusResponse#add() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ExchangeDavMethod.java    From davmail with GNU General Public License v2.0 6 votes vote down vote up
protected void handleProperty(XMLStreamReader reader, MultiStatusResponse multiStatusResponse) throws XMLStreamException {
    while (reader.hasNext() && !XMLStreamUtil.isEndTag(reader, "prop")) {
        reader.next();
        if (XMLStreamUtil.isStartTag(reader)) {
            Namespace namespace = Namespace.getNamespace(reader.getNamespaceURI());
            String tagLocalName = reader.getLocalName();
            if (reader.getAttributeCount() > 0 && "mv.string".equals(reader.getAttributeValue(0))) {
                 handleMultiValuedProperty(reader, multiStatusResponse);
            } else {
                String tagContent = getTagContent(reader);
                if (tagContent != null) {
                    multiStatusResponse.add(new DefaultDavProperty<>(tagLocalName, tagContent, namespace));
                }
            }
        }
    }
}
 
Example 2
Source File: ExchangeDavRequest.java    From davmail with GNU General Public License v2.0 6 votes vote down vote up
protected void handleProperty(XMLStreamReader reader, MultiStatusResponse multiStatusResponse) throws XMLStreamException {
    while (reader.hasNext() && !XMLStreamUtil.isEndTag(reader, "prop")) {
        reader.next();
        if (XMLStreamUtil.isStartTag(reader)) {
            Namespace namespace = Namespace.getNamespace(reader.getNamespaceURI());
            String tagLocalName = reader.getLocalName();
            if (reader.getAttributeCount() > 0 && "mv.string".equals(reader.getAttributeValue(0))) {
                handleMultiValuedProperty(reader, multiStatusResponse);
            } else {
                String tagContent = getTagContent(reader);
                if (tagContent != null) {
                    multiStatusResponse.add(new DefaultDavProperty<>(tagLocalName, tagContent, namespace));
                }
            }
        }
    }
}
 
Example 3
Source File: ExchangeDavMethod.java    From davmail with GNU General Public License v2.0 5 votes vote down vote up
protected void handleMultiValuedProperty(XMLStreamReader reader, MultiStatusResponse multiStatusResponse) throws XMLStreamException {
    String tagLocalName = reader.getLocalName();
    Namespace namespace = Namespace.getNamespace(reader.getNamespaceURI());
    ArrayList<String> values = new ArrayList<>();
    while (reader.hasNext() && !XMLStreamUtil.isEndTag(reader, tagLocalName)) {
        reader.next();
        if (XMLStreamUtil.isStartTag(reader)) {
            String tagContent = getTagContent(reader);
            if (tagContent != null) {
                values.add(tagContent);
            }
        }
    }
    multiStatusResponse.add(new DefaultDavProperty<>(tagLocalName, values, namespace));
}
 
Example 4
Source File: ExchangeDavRequest.java    From davmail with GNU General Public License v2.0 5 votes vote down vote up
protected void handleMultiValuedProperty(XMLStreamReader reader, MultiStatusResponse multiStatusResponse) throws XMLStreamException {
    String tagLocalName = reader.getLocalName();
    Namespace namespace = Namespace.getNamespace(reader.getNamespaceURI());
    ArrayList<String> values = new ArrayList<>();
    while (reader.hasNext() && !XMLStreamUtil.isEndTag(reader, tagLocalName)) {
        reader.next();
        if (XMLStreamUtil.isStartTag(reader)) {
            String tagContent = getTagContent(reader);
            if (tagContent != null) {
                values.add(tagContent);
            }
        }
    }
    multiStatusResponse.add(new DefaultDavProperty<>(tagLocalName, values, namespace));
}
 
Example 5
Source File: CaldavMultiStatusReport.java    From cosmo with Apache License 2.0 5 votes vote down vote up
/**
 * Includes the resource's calendar data in the response as the
 * <code>CALDAV:calendar-data</code> property if it was requested. The
 * calendar data is filtered if a filter was included in the request.
 */
protected MultiStatusResponse
    buildMultiStatusResponse(WebDavResource resource,
                             DavPropertyNameSet props)
    throws CosmoDavException {
    MultiStatusResponse msr =
        super.buildMultiStatusResponse(resource, props);

    DavCalendarResource dcr = (DavCalendarResource) resource;
    if (getPropFindProps().contains(CALENDARDATA)) {
        msr.add(new CalendarData(readCalendarData(dcr)));
    }

    return msr;
}