// Set cache for 1 year, give or take.
response.setHeader( "Cache-Control", "max-age=" + 60 * 60 * 24 * 365 );
response.setHeader( "content-disposition", "inline; filename=\"" + path[ path.length - 1 ] + "\"" );
InputStream resInput = null;
try {
IBasicFile file = Utils.getFileViaAppropriateReadAccess( resource );
if ( file == null ) {
logger.error( "resource not found:" + resource );
response.sendError( HttpServletResponse.SC_INTERNAL_SERVER_ERROR );
return;
}
resInput = file.getContents();
IOUtils.copy( resInput, out );
setCacheControl();
} catch ( SecurityException e ) {
response.sendError( HttpServletResponse.SC_FORBIDDEN );
} catch ( IOException e ) {