browseDirectory.jsp 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <%
  2. /*
  3. * Licensed to the Apache Software Foundation (ASF) under one
  4. * or more contributor license agreements. See the NOTICE file
  5. * distributed with this work for additional information
  6. * regarding copyright ownership. The ASF licenses this file
  7. * to you under the Apache License, Version 2.0 (the
  8. * "License"); you may not use this file except in compliance
  9. * with the License. You may obtain a copy of the License at
  10. *
  11. * http://www.apache.org/licenses/LICENSE-2.0
  12. *
  13. * Unless required by applicable law or agreed to in writing, software
  14. * distributed under the License is distributed on an "AS IS" BASIS,
  15. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  16. * See the License for the specific language governing permissions and
  17. * limitations under the License.
  18. */
  19. %>
  20. <%@ page
  21. contentType="text/html; charset=UTF-8"
  22. import="java.io.IOException"
  23. import="org.apache.hadoop.hdfs.server.common.JspHelper"
  24. import="org.apache.hadoop.util.ServletUtil"
  25. import="org.apache.hadoop.conf.Configuration"
  26. %>
  27. <%!
  28. //for java.io.Serializable
  29. private static final long serialVersionUID = 1L;
  30. %>
  31. <!DOCTYPE html>
  32. <html>
  33. <head>
  34. <style type=text/css>
  35. <!--
  36. body
  37. {
  38. font-face:sanserif;
  39. }
  40. -->
  41. </style>
  42. <%JspHelper.createTitle(out, request, request.getParameter("dir")); %>
  43. </head>
  44. <body onload="document.goto.dir.focus()">
  45. <%
  46. try {
  47. Configuration conf =
  48. (Configuration) application.getAttribute(JspHelper.CURRENT_CONF);
  49. DatanodeJspHelper.generateDirectoryStructure(out,request,response, conf);
  50. }
  51. catch(IOException ioe) {
  52. String msg = ioe.getLocalizedMessage();
  53. int i = msg.indexOf("\n");
  54. if (i >= 0) {
  55. msg = msg.substring(0, i);
  56. }
  57. out.print("<h3>" + msg + "</h3>");
  58. }
  59. %>
  60. <hr>
  61. <h2>Local logs</h2>
  62. <a href="/logs/">Log</a> directory
  63. <%
  64. out.println(ServletUtil.htmlFooter());
  65. %>