* @throws IOException
*/
protected void makeErrorDocument(String errorURI, int status, String summary,
HttpServletRequest request, HttpServletResponse response) throws IOException
{
SWORDErrorDocument sed = new SWORDErrorDocument(errorURI);
Title title = new Title();
title.setContent("ERROR");
sed.setTitle(title);
Calendar calendar = Calendar.getInstance();
String utcformat = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'";
SimpleDateFormat zulu = new SimpleDateFormat(utcformat);
String serializeddate = zulu.format(calendar.getTime());
sed.setUpdated(serializeddate);
Summary sum = new Summary();
sum.setContent(summary);
sed.setSummary(sum);
if (request.getHeader(HttpHeaders.USER_AGENT.toString()) != null) {
sed.setUserAgent(request.getHeader(HttpHeaders.USER_AGENT.toString()));
}
response.setStatus(status);
response.setContentType("application/atom+xml; charset=UTF-8");
PrintWriter out = response.getWriter();
out.write(sed.marshall().toXML());
out.flush();
}