request.setAttribute(ROOTPATH_FILENAME, rootpath);
try {
if (rp.isDirectory()) {
RequestDispatcher rd = request.getRequestDispatcher("/DirectoryList");
rd.forward(request, response);
return;
} else if (filename.endsWith("x") || filename.endsWith("x.")) {
response.setContentType("text/html");
out.println(HTML_DOCTYPE + "<HTML><HEAD><TITLE>" + filename
+ "</TITLE></HEAD>\r\n<BODY>\r\n<H1>Table " + filename
+ "</H1>\r\n");
out.println(getStylesheetHTML(request));
out.println("Skipping VLI format - this format is simply an index to find rows in a corresponding table file, it isn't very interesting to look at so its getting skipped.");
} else if (filename.endsWith("ti")) {
RequestDispatcher rd = request.getRequestDispatcher("/Thematic");
rd.forward(request, response);
} else if (filename.endsWith("si") || filename.endsWith("si.")) {
RequestDispatcher rd = request.getRequestDispatcher("/SpatialIndex");
rd.forward(request, response);
} else if (filename.endsWith(".doc")) {
RequestDispatcher rd = request.getRequestDispatcher("/DocFile");
rd.forward(request, response);
} else {
response.setContentType("text/html");
out.println(HTML_DOCTYPE + "<HTML>\n<HEAD><TITLE>" + filename
+ "</TITLE></HEAD>\r\n<BODY>\r\n<H1>Table " + filename
+ "</H1>\r\n");
out.println(getStylesheetHTML(request));
DcwRecordFile foo = new DcwRecordFile(rootpath);
request.setAttribute(RECORD_FILE_OBJ, foo);
RequestDispatcher rd = request.getRequestDispatcher("/Schema");
rd.include(request, response);
RequestDispatcher rd2 = request.getRequestDispatcher("/Data");
rd2.include(request, response);
foo.close();
}
} catch (FormatException f) {
throw new ServletException("Format Error: ", f);