From 226f2c5b2c408d07a6c098bc62b8db051da6edce Mon Sep 17 00:00:00 2001 From: allo Date: Sun, 8 Oct 2006 14:25:54 +0000 Subject: [PATCH] first version, of the Serverlet Debugger git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@2717 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- htroot/TestApplet.html | 36 +++++++ htroot/TestApplet.java | 109 ++++++++++++++++++++ source/de/anomic/http/httpdFileHandler.java | 6 +- 3 files changed, 148 insertions(+), 3 deletions(-) create mode 100644 htroot/TestApplet.html create mode 100644 htroot/TestApplet.java diff --git a/htroot/TestApplet.html b/htroot/TestApplet.html new file mode 100644 index 000000000..a1f1ca2c5 --- /dev/null +++ b/htroot/TestApplet.html @@ -0,0 +1,36 @@ + + + + YaCy '#[clientname]#': test Applet + #%env/templates/metas.template%# + + + #%env/templates/header.template%# +

Test Applet

+ #(mode)# +
+ + + + + + + + + + +
relative Path/yacysearch.html
Parameters + search=yacy
+ +
+ :: + returned Templates:
+
+ returned Template Structure:
+
+ returned Text:
+
+ #(/mode)# + #%env/templates/footer.template%# + + diff --git a/htroot/TestApplet.java b/htroot/TestApplet.java new file mode 100644 index 000000000..bc6b5a258 --- /dev/null +++ b/htroot/TestApplet.java @@ -0,0 +1,109 @@ +// TestApplet.java +// ----------------------- +// (C) 2006 by Alexander Schier +// part of YACY +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation; either version 2 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.OutputStream; +import java.io.UnsupportedEncodingException; +import java.lang.reflect.InvocationTargetException; +import java.util.Iterator; + +import de.anomic.http.httpHeader; +import de.anomic.http.httpTemplate; +import de.anomic.http.httpdFileHandler; +import de.anomic.plasma.plasmaSwitchboard; +import de.anomic.server.serverByteBuffer; +import de.anomic.server.serverObjects; +import de.anomic.server.serverSwitch; + +public class TestApplet { + public static serverObjects respond(httpHeader header, serverObjects post, serverSwitch env) { + serverObjects prop = new serverObjects(); + plasmaSwitchboard sb = (plasmaSwitchboard) env; + httpdFileHandler filehandler=new httpdFileHandler(sb); + + if(post== null || !post.containsKey("url")){ + prop.put("mode", "0"); + return prop; + } + serverObjects args=new serverObjects(); + + String[] lines=((String)post.get("arguments")).split("\n"); + String[] pair; + for(int i=0;i