Search in sources :

Example 1 with HrefStatus

use of io.milton.http.HrefStatus in project lobcder by skoulouzis.

the class MultiStatusEntity method write.

@Override
public void write(Response response, OutputStream outputStream) throws Exception {
    XmlWriter writer = new XmlWriter(response.getOutputStream());
    writer.writeXMLHeader();
    // only single namespace for this method
    writer.open("multistatus xmlns:D" + "=\"" + WebDavProtocol.NS_DAV + ":\"");
    writer.newLine();
    for (HrefStatus status : getStatii()) {
        XmlWriter.Element elResponse = writer.begin("response").open();
        writer.writeProperty("", "href", status.href);
        writer.writeProperty("", "status", status.status.code + "");
        elResponse.close();
    }
    writer.close("multistatus");
    writer.flush();
}
Also used : HrefStatus(io.milton.http.HrefStatus) XmlWriter(io.milton.http.XmlWriter)

Example 2 with HrefStatus

use of io.milton.http.HrefStatus in project lobcder by skoulouzis.

the class DefaultWebDavResponseHandler method respondDeleteFailed.

@Override
public void respondDeleteFailed(Request request, Response response, Resource resource, Status status) {
    List<HrefStatus> statii = new ArrayList<HrefStatus>();
    statii.add(new HrefStatus(request.getAbsoluteUrl(), status));
    responseMultiStatus(resource, response, request, statii);
}
Also used : ArrayList(java.util.ArrayList) HrefStatus(io.milton.http.HrefStatus)

Aggregations

HrefStatus (io.milton.http.HrefStatus)2 XmlWriter (io.milton.http.XmlWriter)1 ArrayList (java.util.ArrayList)1