%@ 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.hdfs.*" import="org.apache.hadoop.hdfs.server.namenode.*" import="org.apache.hadoop.hdfs.server.datanode.*" import="org.apache.hadoop.hdfs.server.common.*" import="org.apache.hadoop.hdfs.protocol.*" import="org.apache.hadoop.io.*" import="org.apache.hadoop.conf.*" import="org.apache.hadoop.net.DNS" import="org.apache.hadoop.security.token.Token" import="org.apache.hadoop.hdfs.security.token.block.BlockTokenIdentifier" import="org.apache.hadoop.util.*" import="org.apache.hadoop.net.NetUtils" import="org.apache.hadoop.security.UserGroupInformation" import="org.apache.hadoop.http.HtmlQuoting" import="java.text.DateFormat" %> <%! static JspHelper jspHelper = new JspHelper(); public void generateFileChunks(JspWriter out, HttpServletRequest req, Configuration conf ) throws IOException, InterruptedException { long startOffset = 0; int chunkSizeToView = 0; String tokenString = req.getParameter(JspHelper.DELEGATION_PARAMETER_NAME); String referrer = req.getParameter("referrer"); boolean noLink = false; if (referrer == null) { noLink = true; } String filename = HtmlQuoting.unquoteHtmlChars(req.getParameter("filename")); if (filename == null) { out.print("Invalid input (file name absent)"); return; } String namenodeInfoPortStr = req.getParameter("namenodeInfoPort"); int namenodeInfoPort = -1; if (namenodeInfoPortStr != null) namenodeInfoPort = Integer.parseInt(namenodeInfoPortStr); String chunkSizeToViewStr = req.getParameter("chunkSizeToView"); if (chunkSizeToViewStr != null && Integer.parseInt(chunkSizeToViewStr) > 0) chunkSizeToView = Integer.parseInt(chunkSizeToViewStr); else chunkSizeToView = JspHelper.getDefaultChunkSize(conf); if (!noLink) { out.print("