[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gzz-commits] storm/org/nongnu/storm/util HTTPProxy.java
From: |
Benja Fallenstein |
Subject: |
[Gzz-commits] storm/org/nongnu/storm/util HTTPProxy.java |
Date: |
Wed, 23 Apr 2003 11:53:32 -0400 |
CVSROOT: /cvsroot/storm
Module name: storm
Changes by: Benja Fallenstein <address@hidden> 03/04/23 11:53:32
Modified files:
org/nongnu/storm/util: HTTPProxy.java
Log message:
Try on nicer starting page for Storm HTTP gateway
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/storm/storm/org/nongnu/storm/util/HTTPProxy.java.diff?tr1=1.2&tr2=1.3&r1=text&r2=text
Patches:
Index: storm/org/nongnu/storm/util/HTTPProxy.java
diff -u storm/org/nongnu/storm/util/HTTPProxy.java:1.2
storm/org/nongnu/storm/util/HTTPProxy.java:1.3
--- storm/org/nongnu/storm/util/HTTPProxy.java:1.2 Mon Apr 21 17:07:41 2003
+++ storm/org/nongnu/storm/util/HTTPProxy.java Wed Apr 23 11:53:32 2003
@@ -33,6 +33,7 @@
import org.nongnu.storm.http.server.*;
import java.io.*;
import java.net.*;
+import java.util.Iterator;
/** An HTTP server serving blocks from a Storm pool.
*/
@@ -81,6 +82,31 @@
if(uri.startsWith("rewrite/")) {
uri = uri.substring("rewrite/".length());
rewrite = true;
+ }
+
+ if(uri.equals("") || uri.equals("rewrite")) {
+ if(uri.equals("rewrite")) rewrite = true;
+
+ HTTPResponse resp = resf.makeResponse(200, "Ok");
+ resp.setField("Content-Type", "text/html");
+ Writer w = new OutputStreamWriter(resp.getOutputStream(),
"US-ASCII");
+ w.write("<html><head><title>Storm gateway</title>" +
+ "</head><body>\n");
+ w.write("<h1>Storm gateway</h1>\n");
+ if(!rewrite)
+ w.write("<p><a href=\"rewrite/\">URI-rewriting
version</a></p>\n");
+ else
+ w.write("<p><a href=\"../\">Non-URI-rewriting
version</a></p>\n");
+ for(Iterator i=pool.getIds().block().iterator();
+ i.hasNext();) {
+ BlockId id = (BlockId)i.next();
+ String s = id.getURI();
+ if(rewrite) s = REWRITE + s;
+ w.write("<a href=\""+s+"\">"+id+"</a><br>\n");
+ }
+ w.write("</body></html>\n");
+ w.close();
+ return resp;
}
BlockId id = new BlockId(uri);
- [Gzz-commits] storm/org/nongnu/storm/util HTTPProxy.java,
Benja Fallenstein <=
- [Gzz-commits] storm/org/nongnu/storm/util HTTPProxy.java, Tuukka Hastrup, 2003/04/24
- [Gzz-commits] storm/org/nongnu/storm/util HTTPProxy.java, Tuukka Hastrup, 2003/04/24
- [Gzz-commits] storm/org/nongnu/storm/util HTTPProxy.java, Tuukka Hastrup, 2003/04/25
- [Gzz-commits] storm/org/nongnu/storm/util HTTPProxy.java, Tuukka Hastrup, 2003/04/25
- [Gzz-commits] storm/org/nongnu/storm/util HTTPProxy.java, Tuukka Hastrup, 2003/04/25
- [Gzz-commits] storm/org/nongnu/storm/util HTTPProxy.java, Tuukka Hastrup, 2003/04/25
- [Gzz-commits] storm/org/nongnu/storm/util HTTPProxy.java, Tuukka Hastrup, 2003/04/25
- [Gzz-commits] storm/org/nongnu/storm/util HTTPProxy.java, Tuukka Hastrup, 2003/04/26