long starttime = System.currentTimeMillis();
if(path != null && adminInterfaceService.isMenuEntry(path)) {
ResourceEntry data = resourceService.getResource(path);
// if no: proceed with the chain by calling chain.doFilter()
if(data != null && data.getLength() > 0) {
try {
byte [] templatedData = adminInterfaceService.process(data.getData(),path);
data = new ResourceEntry(data.getLocation(),templatedData,templatedData.length,data.getContentType());
HttpServletResponse hresponse = (HttpServletResponse) response;
if(configurationService.getBooleanConfiguration("resources.browsercache.enabled",true)) {
hresponse.setDateHeader("Expires", System.currentTimeMillis()+configurationService.getIntConfiguration("resources.browsercache.seconds",300)*1000);
} else {
hresponse.setHeader("Cache-Control", "no-store");
hresponse.setHeader("Pragma", "no-cache");
hresponse.setDateHeader("Expires", 0);
}
if(data.getContentType() != null && !data.getContentType().contains("unknown")) {
hresponse.setContentType(data.getContentType());
}
hresponse.setContentLength(data.getLength());
hresponse.getOutputStream().write(data.getData());
hresponse.getOutputStream().flush();
hresponse.getOutputStream().close();
if (log.isDebugEnabled()) {
log.debug("request for {} took {}ms", url, System.currentTimeMillis() - starttime);