list.jsp revision eb7a02cafb0857e1143027a016dc2a1975a9af67
f480a2c90c9bf75c2eded1a0577a65b262970552Vladimir Kotal<%--
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye$Id$
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond NorbyeCDDL HEADER START
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond NorbyeThe contents of this file are subject to the terms of the
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond NorbyeCommon Development and Distribution License (the "License").
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond NorbyeYou may not use this file except in compliance with the License.
e7b21c8124ec55ffacc49c1e28a8685834715484Lubos Kosco
e7b21c8124ec55ffacc49c1e28a8685834715484Lubos KoscoSee LICENSE.txt included in this distribution for the specific
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbyelanguage governing permissions and limitations under the License.
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond NorbyeWhen distributing Covered Code, include this CDDL HEADER in each
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbyefile and include the License file at LICENSE.txt.
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond NorbyeIf applicable, add the following below this CDDL HEADER, with the
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbyefields enclosed by brackets "[]" replaced with your own identifying
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbyeinformation: Portions Copyright [yyyy] [name of copyright owner]
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond NorbyeCDDL HEADER END
d961aa46ea0d50fed47802497e45226b1965b12dVladimir Kotal
d961aa46ea0d50fed47802497e45226b1965b12dVladimir KotalCopyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
a8946de730d1f4298332fe8fd0a199bb2f69a764Vladimir KotalPortions Copyright 2011 Jens Elkner.
d961aa46ea0d50fed47802497e45226b1965b12dVladimir Kotal
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye--%><%@page import="
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbyejava.io.BufferedInputStream,
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.comjava.io.BufferedReader,
f480a2c90c9bf75c2eded1a0577a65b262970552Vladimir Kotaljava.io.FileInputStream,
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.comjava.io.FileReader,
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.comjava.io.InputStream,
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.comjava.io.InputStreamReader,
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.comjava.io.Reader,
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.comjava.util.ArrayList,
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.comjava.util.Arrays,
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.comjava.util.List,
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.comjava.util.Set,
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.comjava.util.logging.Level,
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.comjava.util.zip.GZIPInputStream,
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.comorg.opensolaris.opengrok.OpenGrokLogger,
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.comorg.opensolaris.opengrok.analysis.AnalyzerGuru,
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.comorg.opensolaris.opengrok.analysis.Definitions,
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.comorg.opensolaris.opengrok.analysis.FileAnalyzer.Genre,
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.comorg.opensolaris.opengrok.analysis.FileAnalyzerFactory,
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.comorg.opensolaris.opengrok.history.Annotation,
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.comorg.opensolaris.opengrok.index.IndexDatabase,
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.comorg.opensolaris.opengrok.web.DirectoryListing"
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com%><%
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com{
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com // need to set it here since requesting parameters
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com if (request.getCharacterEncoding() == null) {
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com request.setCharacterEncoding("UTF-8");
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com }
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com cfg = PageConfig.get(request);
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com Annotation annotation = cfg.getAnnotation();
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com if (annotation != null) {
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com int r = annotation.getWidestRevision();
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com int a = annotation.getWidestAuthor();
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com cfg.addHeaderData("<style type=\"text/css\">"
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com + ".blame .r { width: " + (r == 0 ? 6 : r) + "ex; } "
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com + ".blame .a { width: " + (a == 0 ? 6 : a) + "ex; } "
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com + "</style>");
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com }
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com}
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com%><%@include
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.comfile="mast.jsp"
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com%><script type="text/javascript">/* <![CDATA[ */
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.comdocument.pageReady.push(function() { pageReadyList();});
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com/* ]]> */</script>
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com<%
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com/* ---------------------- list.jsp start --------------------- */
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com{
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com cfg = PageConfig.get(request);
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com String rev = cfg.getRequestedRevision();
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com File resourceFile = cfg.getResourceFile();
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com String path = cfg.getPath();
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com String basename = resourceFile.getName();
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com String rawPath = request.getContextPath() + Prefix.DOWNLOAD_P + path;
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com Reader r = null;
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com if (cfg.isDir()) {
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com // valid resource is requested
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com // mast.jsp assures, that resourceFile is valid and not /
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com // see cfg.resourceNotAvailable()
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com Project activeProject = Project.getProject(resourceFile);
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com String cookieValue = cfg.getRequestedProjectsAsString();
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com if (activeProject != null) {
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com Set<String> projects = cfg.getRequestedProjects();
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com if (!projects.contains(activeProject.getDescription())) {
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com projects.add(activeProject.getDescription());
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com // update cookie
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com cookieValue = cookieValue.length() == 0
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com ? activeProject.getDescription()
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com : activeProject.getDescription() + '/' + cookieValue;
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com Cookie cookie = new Cookie("OpenGrokProject", cookieValue);
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com // TODO hmmm, projects.jspf doesn't set a path
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com cookie.setPath(request.getContextPath() + '/');
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com response.addCookie(cookie);
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com }
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com }
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com // requesting a directory listing
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com DirectoryListing dl = new DirectoryListing(cfg.getEftarReader());
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com List<String> files = cfg.getResourceFileList();
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com if (!files.isEmpty()) {
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com List<String> readMes = dl.listTo(
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com Util.URIEncodePath(request.getContextPath()),
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com resourceFile, out, path, files);
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com File[] catfiles = cfg.findDataFiles(readMes);
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com for (int i=0; i < catfiles.length; i++) {
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com if (catfiles[i] == null) {
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com continue;
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com }
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com%><h3><%= readMes.get(i) %></h3>
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com<div id="src<%=i%>">
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com <pre><%
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com Util.dump(out, catfiles[i], catfiles[i].getName().endsWith(".gz"));
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com %></pre>
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com</div><%
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com }
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com }
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com } else if (rev.length() != 0) {
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com // requesting a previous revision
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com FileAnalyzerFactory a = AnalyzerGuru.find(basename);
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com Genre g = AnalyzerGuru.getGenre(a);
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com String error = null;
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com if (g == Genre.PLAIN|| g == Genre.HTML || g == null) {
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com InputStream in = null;
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com try {
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com in = HistoryGuru.getInstance()
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com .getRevision(resourceFile.getParent(), basename, rev.substring(2));
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com } catch (Exception e) {
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com // fall through to error message
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com error = e.getMessage();
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com }
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com if (in != null) {
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com try {
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com if (g == null) {
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com a = AnalyzerGuru.find(in);
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com g = AnalyzerGuru.getGenre(a);
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com }
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com if (g == Genre.DATA || g == Genre.XREFABLE
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com || g == null)
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com {
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com%>
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com<div id="src">
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com Binary file [Click <a href="<%= rawPath %>?<%= rev
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com %>">here</a> to download]
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com</div><%
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com } else {
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com%>
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye<div id="src">
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye <span class="pagetitle"><%= basename %> revision <%=
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com rev.substring(2) %></span>
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com <pre><%
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye if (g == Genre.PLAIN) {
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye // We don't have any way to get definitions
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye // for old revisions currently.
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye Definitions defs = null;
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com Annotation annotation = cfg.getAnnotation();
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com //not needed yet
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com //annotation.writeTooltipMap(out);
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com r = new InputStreamReader(in);
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com AnalyzerGuru.writeXref(a, r, out, defs,
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com annotation, Project.getProject(resourceFile));
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com } else if (g == Genre.IMAGE) {
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com %></pre>
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com <img src="<%= rawPath %>?<%= rev %>"/>
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye <pre><%
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye } else if (g == Genre.HTML) {
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com r = new InputStreamReader(in);
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com Util.dump(out, r);
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye } else {
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye %> Click <a href="<%= rawPath %>?<%= rev %>">download <%= basename %></a><%
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye }
d3f4f9ed01f6a0b171d0a81c630f5708e47adb7avitezslav batrla - Sun Microsystems - Prague Czech Republic }
d3f4f9ed01f6a0b171d0a81c630f5708e47adb7avitezslav batrla - Sun Microsystems - Prague Czech Republic } catch (IOException e) {
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye error = e.getMessage();
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com } finally {
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye if (r != null) {
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye try { r.close(); in = null;}
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com catch (Exception e) { /* ignore */ }
d3f4f9ed01f6a0b171d0a81c630f5708e47adb7avitezslav batrla - Sun Microsystems - Prague Czech Republic }
d3f4f9ed01f6a0b171d0a81c630f5708e47adb7avitezslav batrla - Sun Microsystems - Prague Czech Republic if (in != null) {
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com try { in.close(); }
d3f4f9ed01f6a0b171d0a81c630f5708e47adb7avitezslav batrla - Sun Microsystems - Prague Czech Republic catch (Exception e) { /* ignore */ }
d3f4f9ed01f6a0b171d0a81c630f5708e47adb7avitezslav batrla - Sun Microsystems - Prague Czech Republic }
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye }
01745d904b774dade4b2f1921f117c7d96438eefVladimir Kotal %></pre>
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye</div><%
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com } else {
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye%>
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye<h3 class="error">Error reading file</h3><%
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com if (error != null) {
5e6c91d7e77062129cd0b6ac8aaa546dff216419Lubos Kosco%>
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com<p class="error"><%= error %></p><%
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com }
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com }
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com } else if (g == Genre.IMAGE) {
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com%>
5e6c91d7e77062129cd0b6ac8aaa546dff216419Lubos Kosco<div id="src">
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com <img src="<%= rawPath %>?<%= rev %>"/>
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com</div><%
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com } else {
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com%>
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com<div id="src">
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com Binary file [Click <a href="<%= rawPath %>?<%= rev
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com %>">here</a> to download]
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye</div><%
5e6c91d7e77062129cd0b6ac8aaa546dff216419Lubos Kosco }
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye } else {
7f9f5df05a522b79dcf288e598e0a2dbf6980cbeLubos Kosco // requesting cross referenced file
6ba6a49186aff8de4dc5251195b9917021b5ee69Knut Anders Hatlen File xrefFile = null;
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com if (!cfg.annotate()) {
6ba6a49186aff8de4dc5251195b9917021b5ee69Knut Anders Hatlen xrefFile = cfg.findDataFile();
34ce5c2f0e9b0f6bf05895501c9f7171d4a5bab7Lubos Kosco }
34ce5c2f0e9b0f6bf05895501c9f7171d4a5bab7Lubos Kosco if (xrefFile != null) {
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye%>
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com<div id="src">
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye <pre><%
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye Util.dump(out, xrefFile, xrefFile.getName().endsWith(".gz"));
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye %></pre>
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye</div><%
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com } else {
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye // annotate
d20db9dd18673cf482111b9cd3ecc6823d0e45a3Trond Norbye BufferedInputStream bin =
37187cd476e30232cba3afb116e079cb640f984eLubos Kosco new BufferedInputStream(new FileInputStream(resourceFile));
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com try {
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com FileAnalyzerFactory a = AnalyzerGuru.find(basename);
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com Genre g = AnalyzerGuru.getGenre(a);
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com if (g == null) {
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com a = AnalyzerGuru.find(bin);
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com g = AnalyzerGuru.getGenre(a);
f480a2c90c9bf75c2eded1a0577a65b262970552Vladimir Kotal }
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com if (g == Genre.IMAGE) {
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com%>
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com<div id="src">
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com <img src="<%= rawPath %>"/>
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com</div><%
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com } else if ( g == Genre.HTML) {
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com r = new InputStreamReader(bin);
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com Util.dump(out, r);
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com } else if (g == Genre.PLAIN) {
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com%>
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com<div id="src">
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com <pre><%
f480a2c90c9bf75c2eded1a0577a65b262970552Vladimir Kotal // We're generating xref for the latest revision, so we can
f480a2c90c9bf75c2eded1a0577a65b262970552Vladimir Kotal // find the definitions in the index.
f480a2c90c9bf75c2eded1a0577a65b262970552Vladimir Kotal Definitions defs = IndexDatabase.getDefinitions(resourceFile);
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com Annotation annotation = cfg.getAnnotation();
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com r = new InputStreamReader(bin);
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com AnalyzerGuru.writeXref(a, r, out, defs, annotation,
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com Project.getProject(resourceFile));
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com %></pre>
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com</div><%
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com } else {
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com%>
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.comClick <a href="<%= rawPath %>">download <%= basename %></a><%
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com }
f480a2c90c9bf75c2eded1a0577a65b262970552Vladimir Kotal } finally {
8bdb629053c6752f21668f2af5f336109439b15bkrystof.tulinger@oracle.com if (r != null) {
try { r.close(); bin = null; }
catch (Exception e) { /* ignore */ }
}
if (bin != null) {
try { bin.close(); }
catch (Exception e) { /* ignore */ }
}
}
}
}
}
/* ---------------------- list.jsp end --------------------- */
%><%@
include file="foot.jspf"
%>