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