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