Search in sources :

Example 1 with DavMethod

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

the class Report method handle.

@Override
public void handle(DavContext ctxt) throws DavException, IOException, ServiceException {
    if (!ctxt.hasRequestMessage()) {
        throw new DavException("empty request body", HttpServletResponse.SC_BAD_REQUEST, null);
    }
    Document req = ctxt.getRequestMessage();
    Element top = req.getRootElement();
    if (top == null) {
        throw new DavException("empty request body", HttpServletResponse.SC_BAD_REQUEST, null);
    }
    QName topName = top.getQName();
    DavMethod report = sReports.get(topName);
    if (report == null) {
        throw new DavException.UnsupportedReport(topName);
    }
    disableJettyTimeout(ctxt);
    if (ctxt.getDepth() != DavContext.Depth.zero) {
        ctxt.getDavResponse().createResponse(ctxt);
    }
    report.handle(ctxt);
    sendResponse(ctxt);
}
Also used : DavMethod(com.zimbra.cs.dav.service.DavMethod) DavException(com.zimbra.cs.dav.DavException) QName(org.dom4j.QName) Element(org.dom4j.Element) Document(org.dom4j.Document)

Aggregations

DavException (com.zimbra.cs.dav.DavException)1 DavMethod (com.zimbra.cs.dav.service.DavMethod)1 Document (org.dom4j.Document)1 Element (org.dom4j.Element)1 QName (org.dom4j.QName)1