From b423d0a03677edd7fc956b06496075fdefc95314 Mon Sep 17 00:00:00 2001 From: orbiter Date: Thu, 15 Jan 2009 23:52:58 +0000 Subject: [PATCH] moved all servlets from htroot/xml to htroot/api the file server contains a patch that temporary matches all xml paths to api, that means all interfaces still work. Please adopt all your interfaces to the new path. git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@5497 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- .classpath | 9 +++- htroot/WatchCrawler_p.java | 1 - htroot/{xml => api}/blacklists.java | 20 -------- htroot/{xml => api}/blacklists.xml | 0 htroot/{xml => api}/blacklists_p.java | 20 -------- htroot/{xml => api}/blacklists_p.xml | 0 .../{xml => api}/bookmarks/get_bookmarks.java | 19 ------- .../{xml => api}/bookmarks/get_bookmarks.json | 0 .../{xml => api}/bookmarks/get_bookmarks.xml | 0 .../{xml => api}/bookmarks/posts/add_p.java | 24 --------- htroot/{xml => api}/bookmarks/posts/add_p.xml | 0 htroot/{xml => api}/bookmarks/posts/all.java | 27 ---------- htroot/{xml => api}/bookmarks/posts/all.xml | 0 .../bookmarks/posts/delete_p.java | 24 --------- .../{xml => api}/bookmarks/posts/delete_p.xml | 0 htroot/{xml => api}/bookmarks/posts/get.java | 19 ------- htroot/{xml => api}/bookmarks/posts/get.xml | 0 .../bookmarks/tags/getTag.java} | 31 +----------- .../get.xml => api/bookmarks/tags/getTag.xml} | 0 htroot/api/bookmarks/tags/rename_p.java | 22 ++++++++ .../{xml => api}/bookmarks/tags/rename_p.xml | 0 htroot/{xml => api}/bookmarks/xbel/xbel.java | 2 +- htroot/{xml => api}/bookmarks/xbel/xbel.xml | 0 htroot/{xml => api}/config_p.java | 23 --------- htroot/{xml => api}/config_p.xml | 0 htroot/{xml => api}/feed.java | 26 ---------- htroot/{xml => api}/feed.rss | 0 htroot/{xml => api}/queues_p.java | 28 ----------- htroot/{xml => api}/queues_p.xml | 0 htroot/{xml => api}/status_p.java | 21 -------- htroot/{xml => api}/status_p.xml | 0 htroot/{xml => api}/util/getpageinfo_p.java | 27 ---------- htroot/{xml => api}/util/getpageinfo_p.xml | 0 htroot/{xml => api}/util/ynetSearch.java | 27 +--------- htroot/{xml => api}/util/ynetSearch.xml | 0 htroot/api/version.java | 23 +++++++++ htroot/{xml => api}/version.xml | 0 htroot/{xml => api}/webstructure.java | 27 ---------- htroot/{xml => api}/webstructure.xml | 0 htroot/xml/bookmarks/tags/rename_p.java | 50 ------------------- htroot/xml/version.java | 45 ----------------- source/de/anomic/http/httpdFileHandler.java | 25 ++++++---- 42 files changed, 69 insertions(+), 471 deletions(-) rename htroot/{xml => api}/blacklists.java (69%) rename htroot/{xml => api}/blacklists.xml (100%) rename htroot/{xml => api}/blacklists_p.java (76%) rename htroot/{xml => api}/blacklists_p.xml (100%) rename htroot/{xml => api}/bookmarks/get_bookmarks.java (92%) rename htroot/{xml => api}/bookmarks/get_bookmarks.json (100%) rename htroot/{xml => api}/bookmarks/get_bookmarks.xml (100%) rename htroot/{xml => api}/bookmarks/posts/add_p.java (74%) mode change 100644 => 100755 rename htroot/{xml => api}/bookmarks/posts/add_p.xml (100%) rename htroot/{xml => api}/bookmarks/posts/all.java (65%) mode change 100644 => 100755 rename htroot/{xml => api}/bookmarks/posts/all.xml (100%) rename htroot/{xml => api}/bookmarks/posts/delete_p.java (59%) mode change 100644 => 100755 rename htroot/{xml => api}/bookmarks/posts/delete_p.xml (100%) rename htroot/{xml => api}/bookmarks/posts/get.java (77%) mode change 100644 => 100755 rename htroot/{xml => api}/bookmarks/posts/get.xml (100%) rename htroot/{xml/bookmarks/tags/get.java => api/bookmarks/tags/getTag.java} (66%) mode change 100644 => 100755 rename htroot/{xml/bookmarks/tags/get.xml => api/bookmarks/tags/getTag.xml} (100%) create mode 100755 htroot/api/bookmarks/tags/rename_p.java rename htroot/{xml => api}/bookmarks/tags/rename_p.xml (100%) rename htroot/{xml => api}/bookmarks/xbel/xbel.java (99%) mode change 100644 => 100755 rename htroot/{xml => api}/bookmarks/xbel/xbel.xml (100%) rename htroot/{xml => api}/config_p.java (62%) rename htroot/{xml => api}/config_p.xml (100%) rename htroot/{xml => api}/feed.java (78%) rename htroot/{xml => api}/feed.rss (100%) rename htroot/{xml => api}/queues_p.java (85%) rename htroot/{xml => api}/queues_p.xml (100%) rename htroot/{xml => api}/status_p.java (69%) rename htroot/{xml => api}/status_p.xml (100%) rename htroot/{xml => api}/util/getpageinfo_p.java (80%) mode change 100644 => 100755 rename htroot/{xml => api}/util/getpageinfo_p.xml (100%) rename htroot/{xml => api}/util/ynetSearch.java (63%) mode change 100644 => 100755 rename htroot/{xml => api}/util/ynetSearch.xml (100%) create mode 100644 htroot/api/version.java rename htroot/{xml => api}/version.xml (100%) rename htroot/{xml => api}/webstructure.java (66%) rename htroot/{xml => api}/webstructure.xml (100%) delete mode 100644 htroot/xml/bookmarks/tags/rename_p.java delete mode 100644 htroot/xml/version.java diff --git a/.classpath b/.classpath index 5f581035a..c8ae866ba 100644 --- a/.classpath +++ b/.classpath @@ -1,11 +1,16 @@ - + - + + + + + + diff --git a/htroot/WatchCrawler_p.java b/htroot/WatchCrawler_p.java index 804b9de0c..612e5a1d8 100644 --- a/htroot/WatchCrawler_p.java +++ b/htroot/WatchCrawler_p.java @@ -36,7 +36,6 @@ import java.util.Set; import java.util.regex.Pattern; import java.util.regex.PatternSyntaxException; -import xml.queues_p; import de.anomic.crawler.CrawlEntry; import de.anomic.crawler.CrawlProfile; import de.anomic.crawler.SitemapImporter; diff --git a/htroot/xml/blacklists.java b/htroot/api/blacklists.java similarity index 69% rename from htroot/xml/blacklists.java rename to htroot/api/blacklists.java index d0d924266..c56f76c76 100644 --- a/htroot/xml/blacklists.java +++ b/htroot/api/blacklists.java @@ -1,24 +1,4 @@ -// /xml/blacklists.java -// ------------------------------- -// based on /xml/blacklists_p.java (C) 2006 Alexander Schier, changes by Marc Nause -// 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 US - -package xml; import java.io.File; import java.util.List; diff --git a/htroot/xml/blacklists.xml b/htroot/api/blacklists.xml similarity index 100% rename from htroot/xml/blacklists.xml rename to htroot/api/blacklists.xml diff --git a/htroot/xml/blacklists_p.java b/htroot/api/blacklists_p.java similarity index 76% rename from htroot/xml/blacklists_p.java rename to htroot/api/blacklists_p.java index 937c1d1a1..7ad23a615 100644 --- a/htroot/xml/blacklists_p.java +++ b/htroot/api/blacklists_p.java @@ -1,24 +1,4 @@ -// /xml/blacklists_p.java -// ------------------------------- -// (C) 2006 Alexander Schier, changes by Marc Nause -// 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 US - -package xml; import java.io.File; import java.util.List; diff --git a/htroot/xml/blacklists_p.xml b/htroot/api/blacklists_p.xml similarity index 100% rename from htroot/xml/blacklists_p.xml rename to htroot/api/blacklists_p.xml diff --git a/htroot/xml/bookmarks/get_bookmarks.java b/htroot/api/bookmarks/get_bookmarks.java similarity index 92% rename from htroot/xml/bookmarks/get_bookmarks.java rename to htroot/api/bookmarks/get_bookmarks.java index 47cf9cbce..8774a75eb 100644 --- a/htroot/xml/bookmarks/get_bookmarks.java +++ b/htroot/api/bookmarks/get_bookmarks.java @@ -1,23 +1,4 @@ -// /xml/bookmarks/get_bookmarks.java -// ------------------------------- -// (C) 2009 Stefan Förster (apfelmaennchen) -// 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 -package xml.bookmarks; import java.util.Date; import java.util.Iterator; diff --git a/htroot/xml/bookmarks/get_bookmarks.json b/htroot/api/bookmarks/get_bookmarks.json similarity index 100% rename from htroot/xml/bookmarks/get_bookmarks.json rename to htroot/api/bookmarks/get_bookmarks.json diff --git a/htroot/xml/bookmarks/get_bookmarks.xml b/htroot/api/bookmarks/get_bookmarks.xml similarity index 100% rename from htroot/xml/bookmarks/get_bookmarks.xml rename to htroot/api/bookmarks/get_bookmarks.xml diff --git a/htroot/xml/bookmarks/posts/add_p.java b/htroot/api/bookmarks/posts/add_p.java old mode 100644 new mode 100755 similarity index 74% rename from htroot/xml/bookmarks/posts/add_p.java rename to htroot/api/bookmarks/posts/add_p.java index c5e5aeea6..e23c49e55 --- a/htroot/xml/bookmarks/posts/add_p.java +++ b/htroot/api/bookmarks/posts/add_p.java @@ -1,28 +1,4 @@ -// /xml/bookmarks/posts/add_p.java -// ------------------------------- -// part of the AnomicHTTPD caching proxy -// (C) by Michael Peter Christen; mc@yacy.net -// first published on http://www.anomic.de -// Frankfurt, Germany, 2004, 2005 -// -// last major change: 16.09.2008 -// this file is contributed by Stefan Förster -// -// 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -package xml.bookmarks.posts; import java.util.HashMap; import java.util.Set; diff --git a/htroot/xml/bookmarks/posts/add_p.xml b/htroot/api/bookmarks/posts/add_p.xml similarity index 100% rename from htroot/xml/bookmarks/posts/add_p.xml rename to htroot/api/bookmarks/posts/add_p.xml diff --git a/htroot/xml/bookmarks/posts/all.java b/htroot/api/bookmarks/posts/all.java old mode 100644 new mode 100755 similarity index 65% rename from htroot/xml/bookmarks/posts/all.java rename to htroot/api/bookmarks/posts/all.java index 6985111a7..d85ee1fcc --- a/htroot/xml/bookmarks/posts/all.java +++ b/htroot/api/bookmarks/posts/all.java @@ -1,31 +1,4 @@ -// /xml/bookmarks/posts/all.java -// ------------------------------- -// part of the AnomicHTTPD caching proxy -// (C) by Michael Peter Christen; mc@yacy.net -// first published on http://www.anomic.de -// Frankfurt, Germany, 2004, 2005 -// -// last major change: 27.12.2005 -// this file is contributed by Alexander Schier -// -// 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// You must compile this file with -// javac -classpath .:../classes IndexCreate_p.java -// if the shell's current path is HTROOT -package xml.bookmarks.posts; import java.util.Date; import java.util.Iterator; diff --git a/htroot/xml/bookmarks/posts/all.xml b/htroot/api/bookmarks/posts/all.xml similarity index 100% rename from htroot/xml/bookmarks/posts/all.xml rename to htroot/api/bookmarks/posts/all.xml diff --git a/htroot/xml/bookmarks/posts/delete_p.java b/htroot/api/bookmarks/posts/delete_p.java old mode 100644 new mode 100755 similarity index 59% rename from htroot/xml/bookmarks/posts/delete_p.java rename to htroot/api/bookmarks/posts/delete_p.java index 284df2091..5241ee859 --- a/htroot/xml/bookmarks/posts/delete_p.java +++ b/htroot/api/bookmarks/posts/delete_p.java @@ -1,28 +1,4 @@ -// /xml/bookmarks/posts/delete_p.java -// ------------------------------- -// part of the AnomicHTTPD caching proxy -// (C) by Michael Peter Christen; mc@yacy.net -// first published on http://www.anomic.de -// Frankfurt, Germany, 2004, 2005 -// -// last major change: 05.02.2006 -// this file is contributed by Alexander Schier -// -// 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -package xml.bookmarks.posts; import java.net.MalformedURLException; import de.anomic.http.httpRequestHeader; diff --git a/htroot/xml/bookmarks/posts/delete_p.xml b/htroot/api/bookmarks/posts/delete_p.xml similarity index 100% rename from htroot/xml/bookmarks/posts/delete_p.xml rename to htroot/api/bookmarks/posts/delete_p.xml diff --git a/htroot/xml/bookmarks/posts/get.java b/htroot/api/bookmarks/posts/get.java old mode 100644 new mode 100755 similarity index 77% rename from htroot/xml/bookmarks/posts/get.java rename to htroot/api/bookmarks/posts/get.java index 756face1a..12d83e427 --- a/htroot/xml/bookmarks/posts/get.java +++ b/htroot/api/bookmarks/posts/get.java @@ -1,23 +1,4 @@ -// /xml/bookmarks/posts/all.java -// ------------------------------- -// (C) 2006 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 -package xml.bookmarks.posts; import java.text.ParseException; import java.util.ArrayList; diff --git a/htroot/xml/bookmarks/posts/get.xml b/htroot/api/bookmarks/posts/get.xml similarity index 100% rename from htroot/xml/bookmarks/posts/get.xml rename to htroot/api/bookmarks/posts/get.xml diff --git a/htroot/xml/bookmarks/tags/get.java b/htroot/api/bookmarks/tags/getTag.java old mode 100644 new mode 100755 similarity index 66% rename from htroot/xml/bookmarks/tags/get.java rename to htroot/api/bookmarks/tags/getTag.java index fd36d6b2f..0483f8f67 --- a/htroot/xml/bookmarks/tags/get.java +++ b/htroot/api/bookmarks/tags/getTag.java @@ -1,33 +1,4 @@ -// /xml.bookmarks/tags/get.java -// ------------------------------- -// part of the AnomicHTTPD caching proxy -// (C) by Michael Peter Christen; mc@yacy.net -// first published on http://www.anomic.de -// Frankfurt, Germany, 2004, 2005 -// -// last major change: 27.12.2005 -// this file is contributed by Alexander Schier -// -// 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// You must compile this file with -// javac -classpath .:../classes IndexCreate_p.java -// if the shell's current path is HTROOT - -//package xml.bookmarks.tags; -package xml.bookmarks.tags; import java.util.Iterator; import de.anomic.data.bookmarksDB; @@ -37,7 +8,7 @@ import de.anomic.plasma.plasmaSwitchboard; import de.anomic.server.serverObjects; import de.anomic.server.serverSwitch; -public class get { +public class getTag { final static int SORT_ALPHA = 1; final static int SORT_SIZE = 2; final static int SHOW_ALL = -1; diff --git a/htroot/xml/bookmarks/tags/get.xml b/htroot/api/bookmarks/tags/getTag.xml similarity index 100% rename from htroot/xml/bookmarks/tags/get.xml rename to htroot/api/bookmarks/tags/getTag.xml diff --git a/htroot/api/bookmarks/tags/rename_p.java b/htroot/api/bookmarks/tags/rename_p.java new file mode 100755 index 000000000..7d9009f5a --- /dev/null +++ b/htroot/api/bookmarks/tags/rename_p.java @@ -0,0 +1,22 @@ + +import de.anomic.http.httpRequestHeader; +import de.anomic.plasma.plasmaSwitchboard; +import de.anomic.server.serverObjects; +import de.anomic.server.serverSwitch; + +public class rename_p { + public static serverObjects respond(final httpRequestHeader header, final serverObjects post, final serverSwitch env) { + // return variable that accumulates replacements + final plasmaSwitchboard switchboard = (plasmaSwitchboard) env; + final serverObjects prop = new serverObjects(); + prop.put("result", "0");//error + //rename tags + if(post != null && post.containsKey("old") && post.containsKey("new")){ + if(switchboard.bookmarksDB.renameTag(post.get("old"), post.get("new"))) + prop.put("result", "1");//success + } + // return rewrite properties + return prop; + } + +} diff --git a/htroot/xml/bookmarks/tags/rename_p.xml b/htroot/api/bookmarks/tags/rename_p.xml similarity index 100% rename from htroot/xml/bookmarks/tags/rename_p.xml rename to htroot/api/bookmarks/tags/rename_p.xml diff --git a/htroot/xml/bookmarks/xbel/xbel.java b/htroot/api/bookmarks/xbel/xbel.java old mode 100644 new mode 100755 similarity index 99% rename from htroot/xml/bookmarks/xbel/xbel.java rename to htroot/api/bookmarks/xbel/xbel.java index 1256da0bf..4c2f1df74 --- a/htroot/xml/bookmarks/xbel/xbel.java +++ b/htroot/api/bookmarks/xbel/xbel.java @@ -1,4 +1,4 @@ -package xml.bookmarks.xbel; + import java.util.Date; import java.util.Iterator; diff --git a/htroot/xml/bookmarks/xbel/xbel.xml b/htroot/api/bookmarks/xbel/xbel.xml similarity index 100% rename from htroot/xml/bookmarks/xbel/xbel.xml rename to htroot/api/bookmarks/xbel/xbel.xml diff --git a/htroot/xml/config_p.java b/htroot/api/config_p.java similarity index 62% rename from htroot/xml/config_p.java rename to htroot/api/config_p.java index 17c78a8bd..7bbce682d 100644 --- a/htroot/xml/config_p.java +++ b/htroot/api/config_p.java @@ -1,27 +1,4 @@ -// /xml/config_p.java -// ------------------------------- -// (C) 2006 Alexander Schier -// part of YaCy -// -// last major change: 06.02.2006 -// this file is contributed by Alexander Schier -// -// 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 US - -package xml; import java.util.ArrayList; import java.util.Collections; import java.util.Iterator; diff --git a/htroot/xml/config_p.xml b/htroot/api/config_p.xml similarity index 100% rename from htroot/xml/config_p.xml rename to htroot/api/config_p.xml diff --git a/htroot/xml/feed.java b/htroot/api/feed.java similarity index 78% rename from htroot/xml/feed.java rename to htroot/api/feed.java index 0e33475aa..134f43376 100755 --- a/htroot/xml/feed.java +++ b/htroot/api/feed.java @@ -1,30 +1,4 @@ -// feed.java -// (C) 2008 by Michael Peter Christen; mc@yacy.net, Frankfurt a. M., Germany -// first published 25.04.2008 on http://yacy.net -// -// This is a part of YaCy, a peer-to-peer based web search engine -// -// $LastChangedDate: 2006-04-02 22:40:07 +0200 (So, 02 Apr 2006) $ -// $LastChangedRevision: 1986 $ -// $LastChangedBy: orbiter $ -// -// LICENSE -// -// 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -package xml; import java.util.Date; diff --git a/htroot/xml/feed.rss b/htroot/api/feed.rss similarity index 100% rename from htroot/xml/feed.rss rename to htroot/api/feed.rss diff --git a/htroot/xml/queues_p.java b/htroot/api/queues_p.java similarity index 85% rename from htroot/xml/queues_p.java rename to htroot/api/queues_p.java index 0a24f3f9a..3deda768a 100644 --- a/htroot/xml/queues_p.java +++ b/htroot/api/queues_p.java @@ -1,32 +1,4 @@ -// /xml.queues/indexing_p.java -// ------------------------------- -// part of the AnomicHTTPD caching proxy -// (C) by Michael Peter Christen; mc@yacy.net -// first published on http://www.anomic.de -// Frankfurt, Germany, 2004, 2005 -// last major change: 28.10.2005 -// this file is contributed by Alexander Schier -// -// 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// You must compile this file with -// javac -classpath .:../classes IndexCreate_p.java -// if the shell's current path is HTROOT - -//package xml.queues; -package xml; import java.text.SimpleDateFormat; import java.util.ArrayList; diff --git a/htroot/xml/queues_p.xml b/htroot/api/queues_p.xml similarity index 100% rename from htroot/xml/queues_p.xml rename to htroot/api/queues_p.xml diff --git a/htroot/xml/status_p.java b/htroot/api/status_p.java similarity index 69% rename from htroot/xml/status_p.java rename to htroot/api/status_p.java index 6af88171d..ebe601031 100644 --- a/htroot/xml/status_p.java +++ b/htroot/api/status_p.java @@ -1,25 +1,4 @@ -// /xml.queues/status_p.java -// ------------------------------- -// part of the yacy -// -// (C) 2006 Alexander Schier -// last major change: 03.11.2006 -// -// 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 Street, Fifth Floor, Boston, MA 02110-1301 USA. -package xml; import de.anomic.http.httpRequestHeader; import de.anomic.http.httpdByteCountInputStream; diff --git a/htroot/xml/status_p.xml b/htroot/api/status_p.xml similarity index 100% rename from htroot/xml/status_p.xml rename to htroot/api/status_p.xml diff --git a/htroot/xml/util/getpageinfo_p.java b/htroot/api/util/getpageinfo_p.java old mode 100644 new mode 100755 similarity index 80% rename from htroot/xml/util/getpageinfo_p.java rename to htroot/api/util/getpageinfo_p.java index 8559a1f57..883bbb1c0 --- a/htroot/xml/util/getpageinfo_p.java +++ b/htroot/api/util/getpageinfo_p.java @@ -1,31 +1,4 @@ -// /xml/util/gettitle_p.java -// ------------------------------- -// part of the AnomicHTTPD caching proxy -// (C) by Michael Peter Christen; mc@yacy.net -// first published on http://www.anomic.de -// Frankfurt, Germany, 2004, 2005 -// -// last major change: 29.12.2005 -// this file is contributed by Alexander Schier -// -// 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// You must compile this file with -// javac -classpath .:../classes IndexCreate_p.java -// if the shell's current path is HTROOT -package xml.util; import java.io.IOException; import java.io.Writer; import java.net.MalformedURLException; diff --git a/htroot/xml/util/getpageinfo_p.xml b/htroot/api/util/getpageinfo_p.xml similarity index 100% rename from htroot/xml/util/getpageinfo_p.xml rename to htroot/api/util/getpageinfo_p.xml diff --git a/htroot/xml/util/ynetSearch.java b/htroot/api/util/ynetSearch.java old mode 100644 new mode 100755 similarity index 63% rename from htroot/xml/util/ynetSearch.java rename to htroot/api/util/ynetSearch.java index 08334ef6d..b5f179445 --- a/htroot/xml/util/ynetSearch.java +++ b/htroot/api/util/ynetSearch.java @@ -1,29 +1,4 @@ -///xml/util/ynetSearch.java -//(C) 2008 by Stefan Foerster; sof@gmx.de, Hamburg, Germany -//first published 15.05.2008 on http://yacy.net -// -//This is a part of YaCy, a peer-to-peer based web search engine -// -//$LastChangedDate: 2008-05-16 00:44:07 +0200 (Fr, 16 May 2008) $ -//$LastChangedRevision: 4806 $ -//$LastChangedBy: apfelmaennchen $ -// -//LICENSE -// -//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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -package xml.util; + import java.io.IOException; import java.io.InputStream; diff --git a/htroot/xml/util/ynetSearch.xml b/htroot/api/util/ynetSearch.xml similarity index 100% rename from htroot/xml/util/ynetSearch.xml rename to htroot/api/util/ynetSearch.xml diff --git a/htroot/api/version.java b/htroot/api/version.java new file mode 100644 index 000000000..67b421dad --- /dev/null +++ b/htroot/api/version.java @@ -0,0 +1,23 @@ + + +import de.anomic.http.httpRequestHeader; +import de.anomic.server.serverObjects; +import de.anomic.server.serverSwitch; + +public class version { + + public static serverObjects respond(final httpRequestHeader header, final serverObjects post, final serverSwitch env) { + // return variable that accumulates replacements + final serverObjects prop = new serverObjects(); + + prop.put("version", env.getConfig("version", "0.0")); + prop.put("svnRev", env.getConfig("svnRevision", "0")); + prop.put("buildDate", env.getConfig("vdate", "19700101")); + // return rewrite properties + return prop; + } + +} + + + diff --git a/htroot/xml/version.xml b/htroot/api/version.xml similarity index 100% rename from htroot/xml/version.xml rename to htroot/api/version.xml diff --git a/htroot/xml/webstructure.java b/htroot/api/webstructure.java similarity index 66% rename from htroot/xml/webstructure.java rename to htroot/api/webstructure.java index 20a0fbcf1..67fe37f65 100644 --- a/htroot/xml/webstructure.java +++ b/htroot/api/webstructure.java @@ -1,32 +1,5 @@ -// webstructure.java -// (C) 2007 by Michael Peter Christen; mc@yacy.net, Frankfurt a. M., Germany -// first published 22.05.2007 on http://yacy.net -// -// This is a part of YaCy, a peer-to-peer based web search engine -// -// $LastChangedDate: 2006-04-02 22:40:07 +0200 (So, 02 Apr 2006) $ -// $LastChangedRevision: 1986 $ -// $LastChangedBy: orbiter $ -// -// LICENSE -// -// 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -package xml; - import java.util.Iterator; import java.util.Map; diff --git a/htroot/xml/webstructure.xml b/htroot/api/webstructure.xml similarity index 100% rename from htroot/xml/webstructure.xml rename to htroot/api/webstructure.xml diff --git a/htroot/xml/bookmarks/tags/rename_p.java b/htroot/xml/bookmarks/tags/rename_p.java deleted file mode 100644 index 8c60cbb4f..000000000 --- a/htroot/xml/bookmarks/tags/rename_p.java +++ /dev/null @@ -1,50 +0,0 @@ -// /xml.bookmarks/tags/rename_p.java -// ------------------------------- -// part of the AnomicHTTPD caching proxy -// (C) by Michael Peter Christen; mc@yacy.net -// first published on http://www.anomic.de -// Frankfurt, Germany, 2004, 2005 -// last major change: 28.12.2005 -// this file is contributed by Alexander Schier -// -// 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -// You must compile this file with -// javac -classpath .:../classes IndexCreate_p.java -// if the shell's current path is HTROOT - -//package xml.bookmarks.tags; -package xml.bookmarks.tags; -import de.anomic.http.httpRequestHeader; -import de.anomic.plasma.plasmaSwitchboard; -import de.anomic.server.serverObjects; -import de.anomic.server.serverSwitch; - -public class rename_p { - public static serverObjects respond(final httpRequestHeader header, final serverObjects post, final serverSwitch env) { - // return variable that accumulates replacements - final plasmaSwitchboard switchboard = (plasmaSwitchboard) env; - final serverObjects prop = new serverObjects(); - prop.put("result", "0");//error - //rename tags - if(post != null && post.containsKey("old") && post.containsKey("new")){ - if(switchboard.bookmarksDB.renameTag(post.get("old"), post.get("new"))) - prop.put("result", "1");//success - } - // return rewrite properties - return prop; - } - -} diff --git a/htroot/xml/version.java b/htroot/xml/version.java deleted file mode 100644 index 3df6f30bc..000000000 --- a/htroot/xml/version.java +++ /dev/null @@ -1,45 +0,0 @@ -// /xml/version.java -// ------------------------------- -// (C) 2006 Alexander Schier -// part of YaCy -// -// last major change: 06.02.2006 -// this file is contributed by Alexander Schier -// -// 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 US - -package xml; - -import de.anomic.http.httpRequestHeader; -import de.anomic.server.serverObjects; -import de.anomic.server.serverSwitch; - -public class version { - - public static serverObjects respond(final httpRequestHeader header, final serverObjects post, final serverSwitch env) { - // return variable that accumulates replacements - final serverObjects prop = new serverObjects(); - - prop.put("version", env.getConfig("version", "0.0")); - prop.put("svnRev", env.getConfig("svnRevision", "0")); - prop.put("buildDate", env.getConfig("vdate", "19700101")); - // return rewrite properties - return prop; - } - -} - - - diff --git a/source/de/anomic/http/httpdFileHandler.java b/source/de/anomic/http/httpdFileHandler.java index c6c73e7c4..3b7f23d51 100644 --- a/source/de/anomic/http/httpdFileHandler.java +++ b/source/de/anomic/http/httpdFileHandler.java @@ -296,13 +296,16 @@ public final class httpdFileHandler { if (authorization != null && authorization.length() == 0) authorization = null; final String adminAccountBase64MD5 = switchboard.getConfig(httpd.ADMIN_ACCOUNT_B64MD5, ""); - int pos = path.lastIndexOf("."); - + // a bad patch to map the /xml/ path to /api/ + if (path.startsWith("/xml/")) { + path = "/api/" + path.substring(5); + } + final boolean adminAccountForLocalhost = sb.getConfigBool("adminAccountForLocalhost", false); final String refererHost = requestHeader.refererHost(); final boolean accessFromLocalhost = serverCore.isLocalhost(clientIP) && (refererHost.length() == 0 || serverCore.isLocalhost(refererHost)); final boolean grantedForLocalhost = adminAccountForLocalhost && accessFromLocalhost; - final boolean protectedPage = (path.substring(0,(pos==-1)?path.length():pos)).endsWith("_p"); + final boolean protectedPage = path.indexOf("_p.") > 0; final boolean accountEmpty = adminAccountBase64MD5.length() == 0; if (!grantedForLocalhost && protectedPage && !accountEmpty) { @@ -946,14 +949,14 @@ public final class httpdFileHandler { if (targetMd5File.exists()) { //String description = null; targetMD5 = new String(serverFileUtils.read(targetMd5File)); - pos = targetMD5.indexOf('\n'); - if (pos >= 0) { - //description = targetMD5.substring(pos + 1); - targetMD5 = targetMD5.substring(0, pos); - } - - // using the checksum as ETAG header - header.put(httpHeader.ETAG, targetMD5); + int pos = targetMD5.indexOf('\n'); + if (pos >= 0) { + //description = targetMD5.substring(pos + 1); + targetMD5 = targetMD5.substring(0, pos); + } + + // using the checksum as ETAG header + header.put(httpHeader.ETAG, targetMD5); } } catch (final IOException e) { e.printStackTrace();