mast.jsp revision b3ead6812ab6558fee305853599021bd6901d90a
2a90d8a14b0e7cc1508814bc87d3dfa598ef46a8Timo SirainenCDDL HEADER START
d99107ddf4d9bccb710994482daf65276a9d6321Timo SirainenThe contents of this file are subject to the terms of the
d99107ddf4d9bccb710994482daf65276a9d6321Timo SirainenCommon Development and Distribution License (the "License").
2a90d8a14b0e7cc1508814bc87d3dfa598ef46a8Timo SirainenYou may not use this file except in compliance with the License.
2a90d8a14b0e7cc1508814bc87d3dfa598ef46a8Timo SirainenSee LICENSE.txt included in this distribution for the specific
9137c55411aa39d41c1e705ddc34d5bd26c65021Timo Sirainenlanguage governing permissions and limitations under the License.
9137c55411aa39d41c1e705ddc34d5bd26c65021Timo SirainenWhen distributing Covered Code, include this CDDL HEADER in each
2a90d8a14b0e7cc1508814bc87d3dfa598ef46a8Timo Sirainenfile and include the License file at LICENSE.txt.
bbe42963032af89fac1318844da08c742525cc87Timo SirainenIf applicable, add the following below this CDDL HEADER, with the
72b9d8039b714ea57c4e3b31bce32ef41cb414d4Timo Sirainenfields enclosed by brackets "[]" replaced with your own identifying
1299f2c3723ca9ccf8f9e563ec23ee1a1721fe4cTimo Siraineninformation: Portions Copyright [yyyy] [name of copyright owner]
9137c55411aa39d41c1e705ddc34d5bd26c65021Timo SirainenCDDL HEADER END
9137c55411aa39d41c1e705ddc34d5bd26c65021Timo SirainenCopyright 2005 Sun Microsystems, Inc. All rights reserved.
bbe42963032af89fac1318844da08c742525cc87Timo SirainenUse is subject to license terms.
53f37d41e1abb068131320f39f870fc92e81f560Timo Sirainen<%@ page import = "javax.servlet.*,
java.io.*,
<%@ page session="false" %><%@ page errorPage="error.jsp"%><%
String context = request.getContextPath();
String servlet = request.getServletPath();
String reqURI = request.getRequestURI();
String path = request.getPathInfo();
RuntimeEnvironment environment = RuntimeEnvironment.getInstance();
environment.setUrlPrefix(context + "/s?");
String rawSource = environment.getSourceRootPath();
resourcePath = resourceFile.getAbsolutePath();
String basename = resourceFile.getName();
String parentBasename = resourceFile.getParentFile().getName();
IgnoredNames ignoredNames = environment.getIgnoredNames();
String uriEncodedName = Util.URIEncodePath(path);
|| ignoredNames.ignore(path)
|| ignoredNames.ignore(parentBasename)
|| !resourcePath.startsWith(rawSource)) {
response.sendError(404);
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 = !HistoryGuru.getInstance().hasHistory(resourceFile);
!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 (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("")) {
Project proj = Project.getProject(resourceFile);
if (proj != null || !environment.hasProjects()) {
%><input type="hidden" name="project" value="<%=proj.getId()%>"/><%
if(path.length() > 0) {