mast.jsp revision 112
1075N/ASee LICENSE.txt included in this distribution for the specific
1075N/Afile and include the License file at LICENSE.txt.
1075N/A--%><%@ page import = "javax.servlet.*,
1029N/AString context = request.getContextPath();
1408N/AString servlet = request.getServletPath();
1408N/AString reqURI = request.getRequestURI();
1408N/AString path = request.getPathInfo();
1029N/ARuntimeEnvironment environment = RuntimeEnvironment.getInstance();
1029N/AString rawSource = environment.getSourceRootPath();
1123N/AresourcePath = resourceFile.getAbsolutePath();
1374N/AString basename = resourceFile.getName();
1132N/AString parentBasename = resourceFile.getParentFile().getName();
1029N/AIgnoredNames ignoredNames = environment.getIgnoredNames();
1029N/A|| ignoredNames.ignore(path)
1374N/A|| ignoredNames.ignore(parentBasename)
1374N/A|| !resourcePath.startsWith(rawSource)) {
1029N/A response.sendError(404);
1029N/A if(newFile.canRead()) {
1029N/A response.sendRedirect(context + servlet + "/on" + path + "/");
1029N/A response.sendRedirect(context + servlet + "/on" + path);
1029N/A response.sendError(404);
1029N/A if (File.separatorChar == '\\') {
1029N/A path = path.replace('\\','/');
1029N/A isDir = resourceFile.isDirectory();
1029N/A if (isDir && !servlet.startsWith("/xref") && !servlet.startsWith("/hist")) { //if it is an existing directory perhaps people wanted directory xref
1029N/A if(!reqURI.endsWith("/")) {
1029N/A response.sendRedirect(context + "/xref" + path + "/");
1029N/A response.sendRedirect(context + "/xref" + path);
1029N/A } if (isDir && !reqURI.endsWith("/")) {
1029N/A response.sendRedirect(context + servlet + path +"/");
1029N/A long flast = resourceFile.lastModified();
1029N/A if (request.getDateHeader("If-Modified-Since") >= flast ) {
1375N/A response.setDateHeader("Last-Modified", flast);
1375N/A int lastSlash = path.lastIndexOf('/');
1374N/A parent = (lastSlash != -1) ? path.substring(0, lastSlash) : "";
1374N/A int pLastSlash = parent.lastIndexOf('/');
1374N/A parentBasename = pLastSlash != -1 ? parent.substring(pLastSlash+1) : parent;
1374N/A noHistory = !(isDir || HistoryGuru.getInstance().hasHistory(rawSource + "/" + parent));
1374N/A !HistoryGuru.getInstance().hasAnnotation(resourceFile);
dtag = ef.get(path);
if(servlet.startsWith("/xr")) {
ef.close();
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
<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) {