mast.jsp revision 85f619afce0f5860dd3265e1ac5c48efcb353921
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/A path = URLDecoder.decode(path, "ISO-8859-1");
0N/ARuntimeEnvironment environment = RuntimeEnvironment.getInstance();
0N/Aenvironment.setUrlPrefix(context + "/s?");
0N/AString rawSource = environment.getSourceRootPath();
0N/AresourcePath = resourceFile.getAbsolutePath();
0N/AString basename = resourceFile.getName();
0N/AString parentBasename = resourceFile.getParentFile().getName();
0N/AIgnoredNames ignoredNames = environment.getIgnoredNames();
0N/AString uriEncodedName = Util.URIEncodePath(path);
0N/A|| ignoredNames.ignore(path)
0N/A|| ignoredNames.ignore(parentBasename)
0N/A|| !resourcePath.startsWith(rawSource)) {
0N/A response.sendError(404);
0N/A if(newFile.canRead()) {
response.sendRedirect(context + servlet + "/on" + path + "/");
response.sendRedirect(context + servlet + "/on" + path);
response.sendError(404);
if (File.separatorChar == '\\') {
path = path.replace('\\','/');
isDir = resourceFile.isDirectory();
if (isDir && !servlet.startsWith("/xref") && !servlet.startsWith("/hist")) { //if it is an existing directory perhaps people wanted directory xref
if(!reqURI.endsWith("/")) {
response.sendRedirect(context + "/xref" + path + "/");
response.sendRedirect(context + "/xref" + path);
} if (isDir && !reqURI.endsWith("/")) {
response.sendRedirect(context + servlet + path +"/");
long flast = resourceFile.lastModified();
if (request.getDateHeader("If-Modified-Since") >= flast ) {
response.setDateHeader("Last-Modified", flast);
int lastSlash = path.lastIndexOf('/');
parent = (lastSlash != -1) ? path.substring(0, lastSlash) : "";
int pLastSlash = parent.lastIndexOf('/');
parentBasename = pLastSlash != -1 ? parent.substring(pLastSlash+1) : parent;
noHistory = !(isDir || HistoryGuru.getInstance().hasHistory(rawSource + "/" + parent));
!HistoryGuru.getInstance().hasAnnotation(resourceFile);
dtag = ef.get(path);
if(servlet.startsWith("/xr")) {
ef.close();
%><%@ include file="httpheader.jspf" %>
<div id="header"><%@ include file="pageheader.jspf" %>
<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) {
if (rev.length() > 0) {
<script type="text/javascript">
var toggle_js = document.getElementById('toggle-annotate-by-javascript');
var toggle_ss = document.getElementById('toggle-annotate');
toggle_js.style.display = 'inline';
toggle_ss.style.display = 'none';
String rev = request.getParameter("r");
if (rev == null || rev.equals("")) {
if(path.length() > 0) {