From 19286fa2d18d8b582fa47777ef40f21a9338966e Mon Sep 17 00:00:00 2001 From: orbiter Date: Wed, 19 Mar 2008 22:35:19 +0000 Subject: [PATCH] tried to fix seed2.old.db-problem git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@4584 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- source/de/anomic/kelondro/kelondroDyn.java | 13 +++++-------- source/de/anomic/yacy/yacySeedDB.java | 2 +- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/source/de/anomic/kelondro/kelondroDyn.java b/source/de/anomic/kelondro/kelondroDyn.java index fd863ef0b..ca91a55d5 100644 --- a/source/de/anomic/kelondro/kelondroDyn.java +++ b/source/de/anomic/kelondro/kelondroDyn.java @@ -114,15 +114,12 @@ public class kelondroDyn { buffer = new kelondroObjectBuffer(file.toString()); } - public static final void delete(File file, boolean usetree) { - if (usetree) { + public static final void delete(File file) { + if (file.isFile()) { file.delete(); + if (file.exists()) file.deleteOnExit(); } else { - if (file.isDirectory()) { - kelondroFlexWidthArray.delete(file.getParentFile(), file.getName()); - } else { - file.delete(); - } + kelondroFlexWidthArray.delete(file.getParentFile(), file.getName()); } } @@ -199,7 +196,7 @@ public class kelondroDyn { kelondroRow.Entry nt; while (ri.hasNext()) { nt = (kelondroRow.Entry) ri.next(); - if (nt == null) throw new kelondroException("no more elements available"); + if (nt == null) return null; g = nt.getColBytes(0); if (g == null) return null; k = new String(g, 0, keylen); diff --git a/source/de/anomic/yacy/yacySeedDB.java b/source/de/anomic/yacy/yacySeedDB.java index f3ba0e0f6..ba6c0805b 100644 --- a/source/de/anomic/yacy/yacySeedDB.java +++ b/source/de/anomic/yacy/yacySeedDB.java @@ -224,7 +224,7 @@ public final class yacySeedDB { return new kelondroMapObjects(new kelondroDyn(seedDBFile, true, true, commonHashLength, 480, '#', kelondroBase64Order.enhancedCoder, usetree, false, true), 500, sortFields, longaccFields, doubleaccFields, initializeHandlerMethod, this); } catch (Exception e) { // try again - kelondroDyn.delete(seedDBFile, usetree); + kelondroDyn.delete(seedDBFile); return new kelondroMapObjects(new kelondroDyn(seedDBFile, true, true, commonHashLength, 480, '#', kelondroBase64Order.enhancedCoder, usetree, false, true), 500, sortFields, longaccFields, doubleaccFields, initializeHandlerMethod, this); } }