Source:
<code>private void displayFilePage(FileSystem fs, String user, HttpServletRequest req, HttpServletResponse resp, Session session, Path path) throws IOException { Page page = newPage(req, resp, session, "azkaban/viewer/hdfs/velocity/hdfs-file.vm"); page.add("allowproxy", allowGroupProxy); page.add("viewerPath", viewerPath); page.add("viewerName", viewerName); List<Path> paths = new ArrayList<Path>(); List<String> segments = new ArrayList<String>(); getPathSegments(path, paths, segments); page.add("paths", paths); page.add("segments", segments); page.add("user", user); page.add("path", path.toString()); page.add("homedir", getHomeDir(fs)); boolean hasSchema = false; int viewerId = -1; for (int i = 0; i < viewers.size(); ++i) { HdfsFileViewer viewer = viewers.get(i); Set<Capability> capabilities = EnumSet.noneOf(Capability.class); try { capabilities = viewer.getCapabilities(fs, path); } catch (AccessControlException e) { <START> page.add("error_message", "Permission denied(" + i + "): " + e.getMessage()); <END> page.add("no_fs", "true"); page.render(); return; } if (capabilities.contains(Capability.READ)) { if (capabilities.contains(Capability.SCHEMA)) { hasSchema = true; } viewerId = i; break; } } page.add("viewerId", viewerId); page.add("hasSchema", hasSchema); try { FileStatus status = fs.getFileStatus(path); page.add("status", status); } catch (AccessControlException e) { page.add("error_message", "Permission denied: " + e.getMessage()); } catch (IOException e) { page.add("error_message", "Error: " + e.getMessage()); } page.render(); }</code><technical_language>check in "+ i +"</technical_language>

Target:
private void displayFilePage(FileSystem fs, String user, HttpServletRequest req, HttpServletResponse resp, Session session, Path path) throws IOException { Page page = newPage(req, resp, session, "azkaban/viewer/hdfs/velocity/hdfs-file.vm"); page.add("allowproxy", allowGroupProxy); page.add("viewerPath", viewerPath); page.add("viewerName", viewerName); List<Path> paths = new ArrayList<Path>(); List<String> segments = new ArrayList<String>(); getPathSegments(path, paths, segments); page.add("paths", paths); page.add("segments", segments); page.add("user", user); page.add("path", path.toString()); page.add("homedir", getHomeDir(fs)); boolean hasSchema = false; int viewerId = -1; for (int i = 0; i < viewers.size(); ++i) { HdfsFileViewer viewer = viewers.get(i); Set<Capability> capabilities = EnumSet.noneOf(Capability.class); try { capabilities = viewer.getCapabilities(fs, path); } catch (AccessControlException e) { page.add("error_message", "Permission denied (" + viewer.getName() + "): " + e.getMessage()); page.add("no_fs", "true"); page.render(); return; } if (capabilities.contains(Capability.READ)) { if (capabilities.contains(Capability.SCHEMA)) { hasSchema = true; } viewerId = i; break; } } page.add("viewerId", viewerId); page.add("hasSchema", hasSchema); try { FileStatus status = fs.getFileStatus(path); page.add("status", status); } catch (AccessControlException e) { page.add("error_message", "Permission denied: " + e.getMessage()); } catch (IOException e) { page.add("error_message", "Error: " + e.getMessage()); } page.render(); }