VerifierHandler handler = verifier.getVerifierHandler();
verifier.verify(document);
if (!handler.isValid())
{
XcapException e1 = new XcapException(
"Unable to validate document after insertion",
HttpServletResponse.SC_CONFLICT);
StringBuffer sb = new StringBuffer();
sb.append(XcapException.XCAP_ERROR_HEADER);
sb.append("<schema-validation-error/>");
sb.append(XcapException.XCAP_ERROR_FOOTER);
e1.setContent(XcapException.XCAP_ERROR_CONTENT_TYPE, sb
.toString().getBytes());
throw e1;
}
} catch (XcapException e)
{
throw e;
} catch (Throwable e)
{
XcapException e1 = new XcapException(
"Unable to validate document after insertion",
HttpServletResponse.SC_CONFLICT, e);
StringBuffer sb = new StringBuffer();
sb.append(XcapException.XCAP_ERROR_HEADER);
sb.append("<schema-validation-error/>");
sb.append(XcapException.XCAP_ERROR_FOOTER);
e1.setContent(XcapException.XCAP_ERROR_CONTENT_TYPE, sb.toString()
.getBytes());
throw e1;
}
}