mast.jsp revision 47
0N/ASee LICENSE.txt included in this distribution for the specific
0N/Afile and include the License file at LICENSE.txt.
0N/A--%><%@ page import = "javax.servlet.*,
0N/AString context = request.getContextPath();
0N/AString servlet = request.getServletPath();
0N/AString reqURI = request.getRequestURI();
0N/AString path = request.getPathInfo();
0N/AresourcePath = resourceFile.getAbsolutePath();
0N/AString basename = resourceFile.getName();
0N/AString parentBasename = resourceFile.getParentFile().getName();
47N/A|| IgnoredNames.ignore(basename)
47N/A|| IgnoredNames.ignore(parentBasename)
0N/A|| !resourcePath.startsWith(rawSource)) {
0N/A response.sendError(404);
0N/A if(newFile.canRead()) {
0N/A response.sendRedirect(context + servlet + "/on" + path + "/");
0N/A response.sendRedirect(context + servlet + "/on" + path);
0N/A response.sendError(404);
0N/A if (File.separatorChar == '\\') {
0N/A path = path.replace('\\','/');
0N/A isDir = resourceFile.isDirectory();
0N/A if (isDir && !servlet.startsWith("/xref") && !servlet.startsWith("/hist")) { //if it is an existing directory perhaps people wanted directory xref
0N/A if(!reqURI.endsWith("/")) {
0N/A response.sendRedirect(context + "/xref" + path + "/");
0N/A response.sendRedirect(context + "/xref" + path);
0N/A } if (isDir && !reqURI.endsWith("/")) {
0N/A response.sendRedirect(context + servlet + path +"/");
0N/A long flast = resourceFile.lastModified();
0N/A if (request.getDateHeader("If-Modified-Since") >= flast ) {
0N/A response.setDateHeader("Last-Modified", flast);
0N/A int lastSlash = path.lastIndexOf('/');
0N/A parent = (lastSlash != -1) ? path.substring(0, lastSlash) : "";
0N/A int pLastSlash = parent.lastIndexOf('/');
0N/A parentBasename = pLastSlash != -1 ? parent.substring(pLastSlash+1) : parent;
0N/A noHistory = !(isDir || HistoryGuru.getInstance().hasHistory(rawSource + "/" + parent));
0N/A ef = new EftarFileReader(getServletContext().getInitParameter("DATA_ROOT") + "/index/dtags.eftar");
0N/A if(servlet.startsWith("/xr")) {
0N/A<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
0N/A<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US">
0N/A <link rel="alternate stylesheet" type="text/css" media="all" title="Paper White" href="<%=context%>/print.css"/>
0N/A <div id="pagetitle"><b id="filename"><%=basename%><%= isDir ? "/" : "" %></b><br/><%=dtag%></div>
0N/A<div id="Masthead"><tt><a href="<%=context%>/xref/">xref</a>: <%=org.opensolaris.opengrok.web.Util.breadcrumbPath(context + "/xref", path)%><%= isDir ? "/" : "" %></tt></div>
0N/Aif ((!isDir && noHistory) || servlet.startsWith("/hi")) {
0N/A if(path.length() > 0) {