001package org.apache.hadoop.hdfs.server.datanode;
002
003import javax.servlet.*;
004import javax.servlet.http.*;
005import javax.servlet.jsp.*;
006import java.io.IOException;
007import org.apache.hadoop.hdfs.server.common.JspHelper;
008import org.apache.hadoop.util.ServletUtil;
009import org.apache.hadoop.conf.Configuration;
010
011public final class browseDirectory_jsp extends org.apache.jasper.runtime.HttpJspBase
012    implements org.apache.jasper.runtime.JspSourceDependent {
013
014
015  //for java.io.Serializable
016  private static final long serialVersionUID = 1L;
017
018  private static java.util.List _jspx_dependants;
019
020  public Object getDependants() {
021    return _jspx_dependants;
022  }
023
024  public void _jspService(HttpServletRequest request, HttpServletResponse response)
025        throws java.io.IOException, ServletException {
026
027    JspFactory _jspxFactory = null;
028    PageContext pageContext = null;
029    HttpSession session = null;
030    ServletContext application = null;
031    ServletConfig config = null;
032    JspWriter out = null;
033    Object page = this;
034    JspWriter _jspx_out = null;
035    PageContext _jspx_page_context = null;
036
037
038    try {
039      _jspxFactory = JspFactory.getDefaultFactory();
040      response.setContentType("text/html; charset=UTF-8");
041      pageContext = _jspxFactory.getPageContext(this, request, response,
042                        null, true, 8192, true);
043      _jspx_page_context = pageContext;
044      application = pageContext.getServletContext();
045      config = pageContext.getServletConfig();
046      session = pageContext.getSession();
047      out = pageContext.getOut();
048      _jspx_out = out;
049
050
051/*
052 * Licensed to the Apache Software Foundation (ASF) under one
053 * or more contributor license agreements.  See the NOTICE file 
054 * distributed with this work for additional information
055 * regarding copyright ownership.  The ASF licenses this file
056 * to you under the Apache License, Version 2.0 (the
057 * "License"); you may not use this file except in compliance
058 * with the License.  You may obtain a copy of the License at
059 *
060 *     http://www.apache.org/licenses/LICENSE-2.0
061 *
062 * Unless required by applicable law or agreed to in writing, software
063 * distributed under the License is distributed on an "AS IS" BASIS,
064 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
065 * See the License for the specific language governing permissions and
066 * limitations under the License.
067 */
068
069      out.write("<!DOCTYPE html>\n<html>\n<head>\n<style type=text/css>\n<!--\nbody \n  {\n  font-face:sanserif;\n  }\n-->\n</style>\n");
070JspHelper.createTitle(out, request, request.getParameter("dir")); 
071      out.write("</head>\n\n<body onload=\"document.goto.dir.focus()\">\n");
072 
073  try {
074    Configuration conf = 
075      (Configuration) application.getAttribute(JspHelper.CURRENT_CONF);
076    DatanodeJspHelper.generateDirectoryStructure(out,request,response, conf);
077  }
078  catch(IOException ioe) {
079    String msg = ioe.getLocalizedMessage();
080    int i = msg.indexOf("\n");
081    if (i >= 0) {
082      msg = msg.substring(0, i);
083    }
084    out.print("<h3>" + msg + "</h3>");
085  }
086
087      out.write("<hr>\n\n<h2>Local logs</h2>\n<a href=\"/logs/\">Log</a> directory\n\n");
088
089out.println(ServletUtil.htmlFooter());
090
091    } catch (Throwable t) {
092      if (!(t instanceof SkipPageException)){
093        out = _jspx_out;
094        if (out != null && out.getBufferSize() != 0)
095          out.clearBuffer();
096        if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
097      }
098    } finally {
099      if (_jspxFactory != null) _jspxFactory.releasePageContext(_jspx_page_context);
100    }
101  }
102}