diff --git a/htroot/Bookmarks.html b/htroot/Bookmarks.html index ef5163d2d..c03643ee6 100644 --- a/htroot/Bookmarks.html +++ b/htroot/Bookmarks.html @@ -40,19 +40,21 @@ To see a list of all APIs, please visit the
  • Login
  • +
  • List Bookmarks
  • Add Bookmark
  • Import Bookmarks
  • -
  • Bookmarks (XBEL)
  • -
  • Bookmarks (XML)
  • +
  • Bookmarks (XBEL)
  • +
  • Bookmarks (XML)
  • Bookmarks (RSS)
  • ::

    diff --git a/source/de/anomic/data/bookmarksDB.java b/source/de/anomic/data/bookmarksDB.java index 339b08cbc..2f1b31945 100644 --- a/source/de/anomic/data/bookmarksDB.java +++ b/source/de/anomic/data/bookmarksDB.java @@ -46,9 +46,9 @@ import java.util.HashSet; import java.util.Iterator; import java.util.Map; import java.util.Set; -import java.util.TreeMap; import java.util.TreeSet; import java.util.Map.Entry; +import java.util.concurrent.ConcurrentHashMap; import java.util.regex.Pattern; import javax.xml.parsers.DocumentBuilder; @@ -97,7 +97,7 @@ public class bookmarksDB { // tags MapHeap tagsTable; - TreeMap tagCache; + ConcurrentHashMap tagCache; // dates MapHeap datesTable; @@ -111,7 +111,7 @@ public class bookmarksDB { public bookmarksDB(final File bookmarksFile, final File tagsFile, final File datesFile) throws IOException { // bookmarks - tagCache=new TreeMap(); + tagCache = new ConcurrentHashMap(); bookmarksFile.getParentFile().mkdirs(); //this.bookmarksTable = new kelondroMap(kelondroDyn.open(bookmarksFile, bufferkb * 1024, preloadTime, 12, 256, '_', true, false)); //this.bookmarksTable = new MapView(BLOBTree.toHeap(bookmarksFile, true, true, 12, 256, '_', NaturalOrder.naturalOrder, bookmarksFileNew), 1000, '_'); @@ -566,7 +566,7 @@ public class bookmarksDB { while(it.hasNext()){ storeTag(tagCache.get(it.next())); } - tagCache=new TreeMap(); + tagCache = new ConcurrentHashMap(); } public String addTag(final Tag tag) { // TODO: is addTag() really needed - check storeTag() and saveTag() diff --git a/source/de/anomic/http/server/HTTPDFileHandler.java b/source/de/anomic/http/server/HTTPDFileHandler.java index 3f29ca4e5..a7a4a8fa3 100644 --- a/source/de/anomic/http/server/HTTPDFileHandler.java +++ b/source/de/anomic/http/server/HTTPDFileHandler.java @@ -282,7 +282,15 @@ public final class HTTPDFileHandler { if (path.startsWith("/xml/")) { path = "/api/" + path.substring(5); } - + // another bad patch to map the /util/ path to /api/util/ to support old yacybars + if (path.startsWith("/util/")) { + path = "/api/util/" + path.substring(6); + } + // one more for bookmarks + if (path.startsWith("/bookmarks/")) { + path = "/api/bookmarks/" + path.substring(11); + } + final boolean adminAccountForLocalhost = sb.getConfigBool("adminAccountForLocalhost", false); final String refererHost = requestHeader.refererHost(); final boolean accessFromLocalhost = serverCore.isLocalhost(clientIP) && (refererHost.length() == 0 || serverCore.isLocalhost(refererHost));