Search in sources :

Example 11 with DavResponse

use of com.zimbra.cs.dav.service.DavResponse in project zm-mailbox by Zimbra.

the class PropPatch method handle.

@Override
public void handle(DavContext ctxt) throws DavException, IOException, ServiceException {
    if (!ctxt.hasRequestMessage()) {
        throw new DavException("empty request", HttpServletResponse.SC_BAD_REQUEST);
    }
    Document req = ctxt.getRequestMessage();
    Element top = req.getRootElement();
    if (!top.getName().equals(DavElements.P_PROPERTYUPDATE)) {
        throw new DavException("msg " + top.getName() + " not allowed in PROPPATCH", HttpServletResponse.SC_BAD_REQUEST, null);
    }
    DavResource resource = ctxt.getRequestedResource();
    handlePropertyUpdate(ctxt, top, resource, false, PROPPATCH);
    DavResponse resp = ctxt.getDavResponse();
    resp.addResource(ctxt, resource, ctxt.getResponseProp(), false);
    sendResponse(ctxt);
}
Also used : DavResource(com.zimbra.cs.dav.resource.DavResource) DavException(com.zimbra.cs.dav.DavException) DavResponse(com.zimbra.cs.dav.service.DavResponse) Element(org.dom4j.Element) Document(org.dom4j.Document)

Aggregations

DavResponse (com.zimbra.cs.dav.service.DavResponse)11 DavResource (com.zimbra.cs.dav.resource.DavResource)9 RequestProp (com.zimbra.cs.dav.DavContext.RequestProp)8 DavException (com.zimbra.cs.dav.DavException)8 Element (org.dom4j.Element)8 Document (org.dom4j.Document)3 AddressObject (com.zimbra.cs.dav.resource.AddressObject)2 AddressbookCollection (com.zimbra.cs.dav.resource.AddressbookCollection)2 CalendarCollection (com.zimbra.cs.dav.resource.CalendarCollection)2 ArrayList (java.util.ArrayList)2 TimeRange (com.zimbra.cs.dav.caldav.Range.TimeRange)1 Filter (com.zimbra.cs.dav.carddav.Filter)1 ResourceTypeProperty (com.zimbra.cs.dav.property.ResourceTypeProperty)1 CalendarObject (com.zimbra.cs.dav.resource.CalendarObject)1 Collection (com.zimbra.cs.dav.resource.Collection)1 MailItem (com.zimbra.cs.mailbox.MailItem)1 URI (java.net.URI)1 List (java.util.List)1