Object o = it.next();
int statusCode;
if (failures.containsKey(o)) {
Object error = failures.get(o);
statusCode = (error instanceof RepositoryException)
? new JcrDavException((RepositoryException) error).getErrorCode()
: DavServletResponse.SC_INTERNAL_SERVER_ERROR;
} else {
statusCode = (failures.isEmpty()) ? DavServletResponse.SC_OK : DavServletResponse.SC_FAILED_DEPENDENCY;
}
if (o instanceof DavProperty) {
msr.add(((DavProperty) o).getName(), statusCode);
} else {
msr.add((DavPropertyName) o, statusCode);
}
}
return msr;
} catch (RepositoryException e) {
// revert any changes made so far an throw exception
try {
node.refresh(false);
} catch (RepositoryException re) {
// should not happen
}
throw new JcrDavException(e);
}
}