list.jsp revision 1389
0N/ASee LICENSE.txt included in this distribution for the specific
0N/Afile and include the License file at LICENSE.txt.
if (request.getCharacterEncoding() == null) {
request.setCharacterEncoding("UTF-8");
cfg = PageConfig.get(request);
Annotation annotation = cfg.getAnnotation();
float r = annotation.getWidestRevision() * 1.15f;
float a = annotation.getWidestAuthor() * 1.15f;
file="mast.jsp"
/* ---------------------- list.jsp start --------------------- */
cfg = PageConfig.get(request);
String rev = cfg.getRequestedRevision();
File resourceFile = cfg.getResourceFile();
String path = cfg.getPath();
String basename = resourceFile.getName();
if (cfg.isDir()) {
// valid resource is requested: mast.jsp assures, that resourceFile is
// see cfg.resourceNotAvailable()
Project activeProject = Project.getProject(resourceFile);
String cookieValue = cfg.getRequestedProjectsAsString();
Set<String> projects = cfg.getRequestedProjects();
cookieValue = cookieValue.length() == 0
: activeProject.getDescription() + '/' + cookieValue;
// TODO hmmm, projects.jspf doesn't set a path
response.addCookie(cookie);
List<String> files = cfg.getResourceFileList();
if (!files.isEmpty()) {
long now = System.currentTimeMillis();
EftarFileReader.FNode parentFNode = null;
EftarFileReader desc = cfg.getEftarReader();
parentFNode = desc.getNode(path);
offset = parentFNode.childOffset;
IgnoredNames ignoredNames = cfg.getIgnoredNames();
if (path.length() != 0) {
long lastm = resourceFile.getParentFile().lastModified();
<td><%= now-lastm < 86400000 ? "Today" : dateFormatter.format(lastm) %></td>
if (ignoredNames.ignore(file)) {
readMes.add(file);
boolean isDir = child.isDirectory();
long lastm = child.lastModified();
<td><a href="<%= Util.URIEncodePath(file) %>"><%= isDir ? "<b>" + file + "</b>" : file %></a></td>
<td><%= now-lastm < 86400000 ? "Today" : dateFormatter.format(lastm) %></td>
String briefDesc = desc.getChildTag(parentFNode, file); %>
if (readMes.size() != 0) {
File[] xrefs = cfg.findDataFiles(readMes);
for (int i=0; i < xrefs.length; i++) {
readme = new File(resourceFile, readMes.get(i));
g = AnalyzerGuru.getGenre(in);
IOUtils.close(in);
if (g == Genre.IMAGE) {
<h3><%= readMes.get(i) %></h3><%
out.write("<pre>");
XrefInputStream.dump(xrefs[i], out, false);
out.write("</pre>");
<img src="<%= Util.URIEncodePath(rawPath + '/' + image) %>"/><%
} else if (rev.length() != 0) {
FileAnalyzerFactory a = AnalyzerGuru.find(basename);
Genre g = AnalyzerGuru.getGenre(a);
in = HistoryGuru.getInstance()
error = e.getMessage();
a = AnalyzerGuru.find(in);
g = AnalyzerGuru.getGenre(a);
Binary file [Click <a href="<%= Util.URIEncodePath(rawPath) %>?<%= rev
rev.substring(2) %></span><%
if (g == Genre.PLAIN) {
Annotation annotation = cfg.getAnnotation();
AnalyzerGuru.writeXref(a, r, xout , defs,
annotation, Project.getProject(resourceFile));
} else if (g == Genre.IMAGE) {
<img src="<%= Util.URIEncodePath(rawPath) %>?<%= rev %>"/><%
} else if (g == Genre.HTML) {
Util.dump(out, r);
%> Click <a href="<%= Util.URIEncodePath(rawPath) %>?<%=
error = e.getMessage();
try { r.close(); in = null;}
IOUtils.close(in);
IOUtils.close(xout);
} else if (g == Genre.IMAGE) {
<img src="<%= Util.URIEncodePath(rawPath) %>?<%= rev %>"/>
Binary file [Click <a href="<%= Util.URIEncodePath(rawPath) %>?<%= rev
if (!cfg.annotate()) {
xrefFile = cfg.findDataFile();
XrefInputStream.dump(xrefFile, out, true);
FileAnalyzerFactory a = AnalyzerGuru.find(basename);
Genre g = AnalyzerGuru.getGenre(a);
a = AnalyzerGuru.find(bin);
g = AnalyzerGuru.getGenre(a);
if (g == Genre.IMAGE) {
<img src="<%= Util.URIEncodePath(rawPath) %>"/>
} else if (g == Genre.HTML) {
Util.dump(out, r);
} else if (g == Genre.PLAIN) {
Definitions defs = IndexDatabase.getDefinitions(resourceFile);
Annotation annotation = cfg.getAnnotation();
AnalyzerGuru.writeXref(a, r, xout, defs, annotation,
Project.getProject(resourceFile));
Click <a href="<%= Util.URIEncodePath(rawPath) %>">download <%= basename %></a><%
try { r.close(); bin = null; }
IOUtils.close(bin);
IOUtils.close(xout);
/* ---------------------- list.jsp end --------------------- */
include file="foot.jspf"