YMark: more bug fixes

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@7662 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
apfelmaennchen 14 years ago
parent 62855f9567
commit a2e86daae9

@ -167,7 +167,7 @@ public class YMarkHTMLImporter extends HTMLEditorKit.ParserCallback implements R
state = STATE.FOLDER_DESC;
} else if (t == HTML.Tag.DL) {
//TODO: get rid of .toString.equals()
if(!this.folderstring.toString().equals(YMarkTables.FOLDERS_IMPORTED)) {
if(!this.folderstring.toString().equals(this.RootFolder)) {
folderstring.setLength(folderstring.lastIndexOf(YMarkUtil.FOLDERS_SEPARATOR));
}
} else {

@ -27,11 +27,11 @@ public class YMarkJSONImporter implements Runnable, ContentHandler{
public final static String ANNOS = "annos";
public final static String TYPE = "type";
public final static String CHILDREN = "children";
public final static String MILLIS = "000";
// Parser Variables
private final StringBuilder value;
private final StringBuilder key;
private final StringBuilder date;
private final HashMap<String,String> obj;
private int depth;
@ -51,7 +51,8 @@ public class YMarkJSONImporter implements Runnable, ContentHandler{
this.value = new StringBuilder(128);
this.key = new StringBuilder(16);
this.obj = new HashMap<String,String>();
this.date = new StringBuilder(32);
this.obj = new HashMap<String,String>();
this.depth = 0;
this.isAnnos = false;
@ -103,8 +104,14 @@ public class YMarkJSONImporter implements Runnable, ContentHandler{
if(this.isBookmark) {
this.bmk.put(YMarkTables.BOOKMARK.TITLE.key(),obj.get(YMarkTables.BOOKMARK.TITLE.json_attrb()));
this.bmk.put(YMarkTables.BOOKMARK.URL.key(),obj.get(YMarkTables.BOOKMARK.URL.json_attrb()));
this.bmk.put(YMarkTables.BOOKMARK.DATE_ADDED.key(),obj.get(YMarkTables.BOOKMARK.DATE_ADDED.json_attrb())+MILLIS);
this.bmk.put(YMarkTables.BOOKMARK.DATE_MODIFIED.key(),obj.get(YMarkTables.BOOKMARK.DATE_MODIFIED.json_attrb())+MILLIS);
date.setLength(0);
date.append(obj.get(YMarkTables.BOOKMARK.DATE_ADDED.json_attrb()));
date.setLength(date.length()-3);
this.bmk.put(YMarkTables.BOOKMARK.DATE_ADDED.key(), date.toString());
date.setLength(0);
date.append(obj.get(YMarkTables.BOOKMARK.DATE_MODIFIED.json_attrb()));
date.setLength(date.length()-3);
this.bmk.put(YMarkTables.BOOKMARK.DATE_MODIFIED.key(), date.toString());
this.bmk.put(YMarkTables.BOOKMARK.FOLDERS.key(),this.folderstring.toString());
if(this.obj.containsKey(YMarkTables.BOOKMARK.TAGS.json_attrb())) {
this.bmk.put(YMarkTables.BOOKMARK.TAGS.key(),obj.get(YMarkTables.BOOKMARK.TAGS.json_attrb()));

@ -214,7 +214,7 @@ public class YMarkTables {
if(bmk_row.containsKey(BOOKMARK.FOLDERS.key())) {
final String[] folderArray = (new String(bmk_row.get(BOOKMARK.FOLDERS.key()),"UTF8")).split(YMarkUtil.TAGS_SEPARATOR);
for (final String folder : folderArray) {
if(folder.substring(0, root.length()+1).equals(root+'/')) {
if(folder.length() > root.length() && folder.substring(0, root.length()+1).equals(root+'/')) {
if(!folders.contains(folder)) {
path.setLength(0);
path.append(folder);

Loading…
Cancel
Save