rss.jsp revision 7cbf6a20cb1925bd734d2c6664ba739e6e82c8e3
be2e4e54da3c8054525321422f7f290d45b32a6cStéphane GraberCDDL HEADER START
be2e4e54da3c8054525321422f7f290d45b32a6cStéphane GraberThe contents of this file are subject to the terms of the
be2e4e54da3c8054525321422f7f290d45b32a6cStéphane GraberCommon Development and Distribution License (the "License").
be2e4e54da3c8054525321422f7f290d45b32a6cStéphane GraberYou may not use this file except in compliance with the License.
be2e4e54da3c8054525321422f7f290d45b32a6cStéphane GraberSee LICENSE.txt included in this distribution for the specific
be2e4e54da3c8054525321422f7f290d45b32a6cStéphane Graberlanguage governing permissions and limitations under the License.
be2e4e54da3c8054525321422f7f290d45b32a6cStéphane GraberWhen distributing Covered Code, include this CDDL HEADER in each
be2e4e54da3c8054525321422f7f290d45b32a6cStéphane Graberfile and include the License file at LICENSE.txt.
d4f6fa926d92803d8b8217468be483ac2f7e270eStéphane GraberIf applicable, add the following below this CDDL HEADER, with the
d4f6fa926d92803d8b8217468be483ac2f7e270eStéphane Graberfields enclosed by brackets "[]" replaced with your own identifying
d4f6fa926d92803d8b8217468be483ac2f7e270eStéphane Graberinformation: Portions Copyright [yyyy] [name of copyright owner]
d4f6fa926d92803d8b8217468be483ac2f7e270eStéphane GraberCDDL HEADER END
9a42db48e0bcf4f34b05a3de1cda23e06f51d131Stéphane GraberCopyright 2005 Sun Microsystems, Inc. All rights reserved.
be2e4e54da3c8054525321422f7f290d45b32a6cStéphane GraberUse is subject to license terms.
be2e4e54da3c8054525321422f7f290d45b32a6cStéphane Graberident "@(#)rss.jsp 1.2 05/12/02 SMI"
c13c0e08da7dbfecb52e85233ac6cd17afa5d818Stéphane Graber--%><%@ page import = "javax.servlet.*,
%><%@ page session="false" %><%@ page errorPage="error.jsp"%><%
String context = request.getContextPath();
String servlet = request.getServletPath();
String reqURI = request.getRequestURI();
String path = request.getPathInfo();
RuntimeEnvironment env = RuntimeEnvironment.getInstance();
env.setUrlPrefix(context + "/s?");
env.register();
String rawSource = env.getSourceRootPath();
resourcePath = resourceFile.getAbsolutePath();
String basename = resourceFile.getName();
String parentBasename = resourceFile.getParentFile().getName();
IgnoredNames ignoredNames = env.getIgnoredNames();
|| !resourcePath.startsWith(rawSource)
|| !resourceFile.canRead()
response.sendError(404);
if (File.separatorChar == '\\') {
path = path.replace('\\','/');
isDir = resourceFile.isDirectory();
if (isDir && !reqURI.endsWith("/")) {
response.sendRedirect(context + servlet + path +"/");
dtag = ef.get(path);
ef.close();
int lastSlash = path.lastIndexOf('/');
parent = (lastSlash != -1) ? path.substring(0, lastSlash) : "";
int pLastSlash = parent.lastIndexOf('/');
parentBasename = pLastSlash != -1 ? parent.substring(pLastSlash+1) : parent;
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<link><%=request.getRequestURL()%></link>
String[] apaths = request.getParameterValues("also");
if (apaths!= null && apaths.length>0) {
for(int i=0; i< apaths.length; i++) {
paths.append(' ');
paths.append(apaths[i]);
apath = paths.toString();
hr = HistoryGuru.getInstance().getHistoryReader(f);
while (hr.next() && i-- > 0) {
String rev = hr.getRevision();
if(hr.isActive()) {
List<String> files = hr.getFiles();
%><%=path%> - <%=hr.getRevision()%><%
<pubDate><%=hr.getDate()%></pubDate>
<dc:creator><%=hr.getAuthor()%></dc:creator>
hr.close();