// prepare undo
Object oldvalues[] = this.values;
DAVBody body = getBody(request);
Document document =
DAVBody.createDocument(DAVNode.MULTISTATUS_NODE);
DAVResponse dr =
DAVFactory.createResponse(getURL(request).getFile(),
//toExternalForm(),
document);
// attach the response to the document
document.getDocumentElement().appendChild(dr.getNode());
if (body != null) {
DAVPropertyUpdate dpu = body.getPropertyUpdate();
if (dpu != null) {
DAVPropAction dpas[] = dpu.getActions();
DAVPropStat dps = null;
int len = dpas.length;
try {
for (int i = 0 ; i < len ; i++) {
DAVPropAction dpa = dpas[i];
switch (dpa.getAction())
{
case DAVPropAction.SET:
dps = setDAVProperties(
dpa.getProperties(),
document);
break;
case DAVPropAction.REMOVE:
dps = removeDAVProperties(
dpa.getProperties(),
document);
break;
default:
// error
Reply error =
request.makeReply(HTTP.BAD_REQUEST);
error.setContent("Invalid request");
throw new HTTPException (error);
}
if (dps != null) {
dr.addDAVNode(dps);
}
}
saveDeadProperties();
} catch (DAVPropertyException ex) {
// stop all an undo change
reloadDeadProperties();
this.values = oldvalues;
// report error
DAVPropStat dpss[] = (DAVPropStat[])ex.getReason();
for (int j = 0 ; j < dpss.length ; j++) {
dr.addDAVNode(dpss[j]);
}
dr.setDescription(ex.getMessage());
}
return createDAVReply(request,
WEBDAV.MULTI_STATUS,
document);
}