* Return a document
*/
@SuppressWarnings("unchecked")
public static ResponseContext returnBase(Base base, int status, Date lastModified) {
log.debug(Localizer.get("RETURNING.DOCUMENT"));
BaseResponseContext response = new BaseResponseContext(base);
response.setStatus(status);
if (lastModified != null)
response.setLastModified(lastModified);
// response.setContentType(MimeTypeHelper.getMimeType(base));
Document doc = base instanceof Document ? (Document)base : ((Element)base).getDocument();
if (doc.getEntityTag() != null) {
response.setEntityTag(doc.getEntityTag());
} else if (doc.getLastModified() != null) {
response.setLastModified(doc.getLastModified());
}
return response;
}