%@ page contentType="text/html; charset=UTF-8" import="javax.servlet.*" import="javax.servlet.http.*" import="java.io.*" import="java.util.*" import="java.net.*" import="org.apache.hadoop.dfs.*" import="org.apache.hadoop.io.*" import="org.apache.hadoop.conf.*" import="java.text.DateFormat" %> <%! static JspHelper jspHelper = new JspHelper(); public void generateFileChunks(JspWriter out, HttpServletRequest req) throws IOException { long startOffset = 0; int chunkSizeToView = 0; String referrer = req.getParameter("referrer"); boolean noLink = false; if (referrer == null) { noLink = true; } String filename = req.getParameter("filename"); if (filename == null) { out.print("Invalid input (filename absent)"); return; } String chunkSizeToViewStr = req.getParameter("chunkSizeToView"); if (chunkSizeToViewStr != null && Integer.parseInt(chunkSizeToViewStr) > 0) chunkSizeToView = Integer.parseInt(chunkSizeToViewStr); else chunkSizeToView = jspHelper.defaultChunkSizeToView; if (!noLink) out.print("