ServletContext servletContext = (ServletContext) context.getExternalContext().getContext();
String contentType = servletContext.getMimeType(fileName);
response.setContentType(contentType);
response.setHeader("Content-Disposition", "attachment;filename=\"" + fileName + "\"");
response.sendRedirect(goobiContentServerUrl.toString());
context.responseComplete();
}
if (metsTempFile.toURI().toURL() != null) {
File tempMets = new File(metsTempFile.toURI().toURL().toString());
tempMets.delete();
}