raw.jsp revision 1473
422N/ASee LICENSE.txt included in this distribution for the specific
422N/Afile and include the License file at LICENSE.txt.
422N/Ainclude file="pageconfig.jspf"
422N/A cfg = PageConfig.get(request);
422N/A String redir = cfg.canProcess();
422N/A if (redir == null || redir.length() > 0) {
422N/A response.sendRedirect(redir);
422N/A String revision = cfg.getRequestedRevision();
422N/A if (revision.length() == 0) {
422N/A long flast = f.lastModified()/1000 * 1000;
422N/A long lmdate = cfg.getConfig().getLastModified();
422N/A if (request.getDateHeader("If-Modified-Since") >= flast) {
response.setDateHeader("Last-Modified", flast);
IOUtils.close(in); // can't do that in finally - in still needed
String mimeType = getServletContext().getMimeType(f.getPath());
response.setContentType(mimeType);
response.setHeader("content-disposition", "attachment; filename="
+ f.getName());
OutputStream o = response.getOutputStream();
while ((nr = in.read(buffer)) > 0) {
o.write(buffer, 0, nr);
o.flush();
o.close();
IOUtils.close(in);
/* ---------------------- raw.jsp end-------------------- */