mast.jsp revision 9ec7787531611654e8f50932473aa48963eaba55
80833bb9a1bf25dcf19e814438a4b311d2e1f4cffuankgCDDL HEADER START
1337c7673efc1f80f634139fbad7cbb98a0dc657ylavicThe contents of this file are subject to the terms of the
1337c7673efc1f80f634139fbad7cbb98a0dc657ylavicCommon Development and Distribution License (the "License").
1337c7673efc1f80f634139fbad7cbb98a0dc657ylavicYou may not use this file except in compliance with the License.
4da61833a1cbbca94094f9653fd970582b97a72etrawickSee LICENSE.txt included in this distribution for the specific
4da61833a1cbbca94094f9653fd970582b97a72etrawicklanguage governing permissions and limitations under the License.
4da61833a1cbbca94094f9653fd970582b97a72etrawickWhen distributing Covered Code, include this CDDL HEADER in each
4da61833a1cbbca94094f9653fd970582b97a72etrawickfile and include the License file at LICENSE.txt.
4789804be088bcd86ae637a29cdb7fda25169521jailletcIf applicable, add the following below this CDDL HEADER, with the
4789804be088bcd86ae637a29cdb7fda25169521jailletcfields enclosed by brackets "[]" replaced with your own identifying
4789804be088bcd86ae637a29cdb7fda25169521jailletcinformation: Portions Copyright [yyyy] [name of copyright owner]
e50c3026198fd496f183cda4c32a202925476778covenerCDDL HEADER END
e50c3026198fd496f183cda4c32a202925476778covenerCopyright 2005 Sun Microsystems, Inc. All rights reserved.
5b88c8507d5ef6d0c4cfbc78230294968175b638minfrinUse is subject to license terms.
6c3b9cebb551140fbb25d58bae08b539b3802133ylavicident "%Z%%M% %I% %E% SMI"
6c3b9cebb551140fbb25d58bae08b539b3802133ylavic--%><%@ page import = "javax.servlet.*,
69301145375a889e7e37caf7cc7321ac0f91801erpluem%><%@ page session="false" %><%@ page errorPage="error.jsp"%><%
506bfe33206b2fece40ef25f695af39dd4130facjkaluzaString context = request.getContextPath();
506bfe33206b2fece40ef25f695af39dd4130facjkaluzaString servlet = request.getServletPath();
506bfe33206b2fece40ef25f695af39dd4130facjkaluzaString reqURI = request.getRequestURI();
506bfe33206b2fece40ef25f695af39dd4130facjkaluzaString path = request.getPathInfo();
d58a848a016d401b965111e50ef829e1641f7834minfrinif (path == null) path = "";
d58a848a016d401b965111e50ef829e1641f7834minfrinRuntimeEnvironment environment = RuntimeEnvironment.getInstance();
2e6f4d654c96c98b761fb012fd25c5d5b1558c44sfString rawSource = environment.getSourceRootPath();
2e6f4d654c96c98b761fb012fd25c5d5b1558c44sfString resourcePath = rawSource + path;
2e6f4d654c96c98b761fb012fd25c5d5b1558c44sfFile resourceFile = new File(resourcePath);
17e6c95f3b22d18acdf8380fb26a8d0e10c80767ylavicboolean valid = true;
17e6c95f3b22d18acdf8380fb26a8d0e10c80767ylavicboolean noHistory = true;
17e6c95f3b22d18acdf8380fb26a8d0e10c80767ylavicString basename = resourceFile.getName();
17e6c95f3b22d18acdf8380fb26a8d0e10c80767ylavicboolean isDir = false;
e8bd80a4bb88199d2f9a24a50345688e52d9c116ylavicEftarFileReader ef = null;
e8bd80a4bb88199d2f9a24a50345688e52d9c116ylavicString parent = null;
e8bd80a4bb88199d2f9a24a50345688e52d9c116ylavicString parentBasename = resourceFile.getParentFile().getName();
330e16bea8fe9cace4de90c349750c03dfb1fe64ylavic|| IgnoredNames.ignore(parentBasename)
330e16bea8fe9cace4de90c349750c03dfb1fe64ylavic|| !resourcePath.startsWith(rawSource)) {
330e16bea8fe9cace4de90c349750c03dfb1fe64ylavic valid = false;
d7205b1a86c51c27b71a2c458dc453fd53a261c1covener} else if (!resourceFile.canRead() && resourcePath.startsWith(rawSource)) {
d7205b1a86c51c27b71a2c458dc453fd53a261c1covener String newPath = rawSource + "/on/" + path;
d7205b1a86c51c27b71a2c458dc453fd53a261c1covener File newFile = new File(newPath);
d7205b1a86c51c27b71a2c458dc453fd53a261c1covener if(newFile.isDirectory() && servlet.startsWith("/xref") && !path.endsWith("/")) {
44ff304057225e944e220e981d434a046d14cf06covener response.sendRedirect(context + servlet + "/on" + path + "/");
44ff304057225e944e220e981d434a046d14cf06covener response.sendRedirect(context + servlet + "/on" + path);
5d1ba75b8794925e67591c209085a49279791de9covener valid = false;
032982212dbcc7c3cce95bf89c503bb56e185ac7kbrand valid = true;
caad2986f81ab263f7af41467dd622dc9add17f3ylavic if ("".equals(path)) {
caad2986f81ab263f7af41467dd622dc9add17f3ylavic path = "/";
caad2986f81ab263f7af41467dd622dc9add17f3ylavic if (File.separatorChar == '\\') {
45a10d38e6051fd7bdf9d742aaae633d97ff02abjailletc path = path.replace('\\','/');
2165214331e4afafca4048f66f303d0253d7b001covener if (isDir && !servlet.startsWith("/xref") && !servlet.startsWith("/hist")) { //if it is an existing directory perhaps people wanted directory xref
a34684a59b60a4173c25035d0c627ef17e6dc215rpluem response.sendRedirect(context + "/xref" + path + "/");
1e2d421a36999d292042a5539971070d54aa6c63ylavic response.sendRedirect(context + "/xref" + path);
fa7ed98b9dc94c5845cf845aea0a44ecacd290c9humbedooh } if (isDir && !reqURI.endsWith("/")) {
fa7ed98b9dc94c5845cf845aea0a44ecacd290c9humbedooh response.sendRedirect(context + servlet + path +"/");
0b67eb8568cd58bb77082703951679b42cf098actrawick String dtag = "";
5ef3c61605a3a021ff71f488983cb0065f8e1a79covener if (request.getDateHeader("If-Modified-Since") >= flast ) {
fb1985a97912b25ec6564c73e610a31e5fc6e25fcovener response.setStatus(HttpServletResponse.SC_NOT_MODIFIED);
09c87c777bed1655621bb20e1c46cb6b1a63279dcovener valid = false;
3060ce7f798fbda7999cd4ddf89b525d2b294185covener response.setDateHeader("Last-Modified", flast);
c1a63b8fad09c419c1a64f75993feb8a343a6801ylavic int lastSlash = path.lastIndexOf('/');
c1a63b8fad09c419c1a64f75993feb8a343a6801ylavic parent = (lastSlash != -1) ? path.substring(0, lastSlash) : "";
c1a63b8fad09c419c1a64f75993feb8a343a6801ylavic int pLastSlash = parent.lastIndexOf('/');
e6b4bd1113567627ab6bb6c6a7105e1e01a7d889jailletc parentBasename = pLastSlash != -1 ? parent.substring(pLastSlash+1) : parent;
e6b4bd1113567627ab6bb6c6a7105e1e01a7d889jailletc noHistory = !(isDir || HistoryGuru.getInstance().hasHistory(rawSource + "/" + parent));
e466c40e1801982602ee0200c9e8b61cc148742djailletc ef = new EftarFileReader(environment.getDataRootPath() + "/index/dtags.eftar");
457468b82e59d01eba00dd9d0817309c8f5e414ejim dtag = ef.get(path);
04983e3bd1754764eec7d6bb772fe3b0bf391771jorton if(ef != null) {
15660979a30d251681463de2e0584853890082accovener } catch (IOException e) {
15660979a30d251681463de2e0584853890082accovener } finally {
cfd9415521847b2f9394fad04fb701cfb955f503rjung } catch (Exception e) {
28c31fb73c1264bd1d0ff932573677030b024c7dwrowe%><?xml version="1.0" encoding="iso-8859-1"?>
28c31fb73c1264bd1d0ff932573677030b024c7dwrowe<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
28c31fb73c1264bd1d0ff932573677030b024c7dwrowe<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US">
63b9f1f5880391261705f696d7d65507bbe9ace3covener <meta name="robots" content="noindex,nofollow">
63b9f1f5880391261705f696d7d65507bbe9ace3covener <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
63b9f1f5880391261705f696d7d65507bbe9ace3covener <title>Cross Reference: <%=path%></title>
49dacedb6c387b786b7911082ff35121a45f414bcovener <link rel="icon" href="<%=context%>/img/icon.png" type="image/png"/>
49dacedb6c387b786b7911082ff35121a45f414bcovener <link rel="stylesheet" type="text/css" href="<%=context%>/style.css"/>
49dacedb6c387b786b7911082ff35121a45f414bcovener <link rel="stylesheet" type="text/css" href="<%=context%>/print.css" media="print" />
49dacedb6c387b786b7911082ff35121a45f414bcovener <link rel="alternate stylesheet" type="text/css" media="all" title="Paper White" href="<%=context%>/print.css"/>
3c990331fc6702119e4f5b8ba9eae3021aea5265jim<body><div id="page">
3c990331fc6702119e4f5b8ba9eae3021aea5265jim<form action="<%=context%>/search">
3c990331fc6702119e4f5b8ba9eae3021aea5265jim <div id="header">
fc42512879dd0504532f52fe5d0d0383dda96a1eniq <%= getServletContext().getInitParameter("HEADER") %>
fc42512879dd0504532f52fe5d0d0383dda96a1eniq <div id="pagetitle"><b id="filename">Cross Reference: <%=path%></b><br/><%=dtag%></div>
0451df5dc50fa5d8b3e07d92ee6a92e36a1181a5niq<div id="Masthead"><tt><a href="<%=context%>/xref/">xref</a>: <%=org.opensolaris.opengrok.web.Util.breadcrumbPath(context + "/xref", path)%></tt></div>
0451df5dc50fa5d8b3e07d92ee6a92e36a1181a5niq<div id="bar"><a href="<%=context%>" id="home">Home</a> |
983528026996668ea295be95aedb9c7a346af470ylavicif ((!isDir && noHistory) || servlet.startsWith("/hi")) {
da0442c0440caef34706e2c2f3af05cb65921cc0jailletc %> <span class="c" id="history">History</span> |<%
06b8f183140c8e02e0974e938a05078b511d1603covener %><a id="history" href="<%=context%>/history<%=path%>">History</a> |<%
06b8f183140c8e02e0974e938a05078b511d1603covener if (!isDir) {
15890c9306ba98f6fc243e15a3c4778ddc7d773erpluem %> <a id="download" href="<%=context%>/raw<%=path%>">Download</a> | <%
259878293a997ff49f5ddfc53d3739cbdc25444ecovener%> <input id="search" name="q" class="q"/>
259878293a997ff49f5ddfc53d3739cbdc25444ecovener<input type="submit" value="Search" class="submit"/><%
b54b024c06a19926832d77d40ba35ad8c41e4d3dminfrin %><input type="checkbox" name="path" value="<%=path%>"/> only in <b><%=path%></b><%
65967d05f839dbf27cf91d91fa79585eeae19660minfrin %><input type="checkbox" name="path" value="<%=parent%>"/> only in <b><%=parentBasename%></b><%
8152945ae46857b170cb227e79bb799f4fc7710dminfrin%></div></form><%
8152945ae46857b170cb227e79bb799f4fc7710dminfrin} // date check
75f5c2db254c0167a0e396254460de09b775d203trawick } // not a directory redirect