From b1fae9b5af0a7f5863708daf0c4428490e657275 Mon Sep 17 00:00:00 2001 From: apfelmaennchen Date: Fri, 25 Jan 2008 19:22:36 +0000 Subject: [PATCH] fixed import Netscape Bookmarks git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@4401 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- source/de/anomic/data/bookmarksDB.java | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/source/de/anomic/data/bookmarksDB.java b/source/de/anomic/data/bookmarksDB.java index d450134e2..26a7f272d 100644 --- a/source/de/anomic/data/bookmarksDB.java +++ b/source/de/anomic/data/bookmarksDB.java @@ -580,30 +580,34 @@ public class bookmarksDB { } } public int importFromBookmarks(yacyURL baseURL, InputStreamReader input, String tag, boolean importPublic){ + int importCount = 0; HashMap links=new HashMap(); Iterator it; - String url,title; + String title; + yacyURL url; Bookmark bm; Set tags=listManager.string2set(tag); //this allow multiple default tags try { //load the links - htmlFilterContentScraper scraper = new htmlFilterContentScraper(baseURL); + htmlFilterContentScraper scraper = new htmlFilterContentScraper(baseURL); //OutputStream os = new htmlFilterOutputStream(null, scraper, null, false); Writer writer= new htmlFilterWriter(null,null,scraper, null, false); serverFileUtils.copy(input,writer); writer.close(); - links = (HashMap) scraper.getAnchors(); + links = (HashMap) scraper.getAnchors(); } catch (IOException e) {} it=links.keySet().iterator(); while(it.hasNext()){ - url=(String) it.next(); + // url=(String) it.next(); + url= (yacyURL) it.next(); title=(String) links.get(url); + serverLog.logInfo("BOOKMARKS", "links.get(url)"); if(title.equals("")){//cannot be displayed - title=url; + title=url.toString(); } - bm=new Bookmark(url); + bm=new Bookmark(url.toString()); bm.setProperty(Bookmark.BOOKMARK_TITLE, title); bm.setTags(tags); bm.setPublic(importPublic);