throws Exception {
// the media type of the defect is not sent because it is not known,
// so we need to guess it
body = body.trim();
DefectAsset asset = new DefectAsset();
if (body.startsWith("<defect")) {
// read the incoming entity as xml
DefectBean defect =
ProviderUtils.readFromString(providers,
body,
DefectBean.class,
MediaType.APPLICATION_XML_TYPE);
asset.setDefect(defect);
} else if (body.startsWith("<entry")) {
// read the incoming entity as an atom entry
SyndEntry entry =
ProviderUtils.readFromString(providers,
body,
SyndEntry.class,
MediaType.APPLICATION_ATOM_XML_TYPE);
asset.setSyndEntry(entry, providers);
} else {
logger.error("WebDAV defect update can only handle xml or atom entry");
throw new WebApplicationException(Response.Status.UNSUPPORTED_MEDIA_TYPE);
}
asset.getDefect().setId(defectId);
try {
// update the defect
return super.updateDefect(asset, linkProcessor, defectId);
} catch (WebApplicationException e) {