tried to fix seed2.old.db-problem

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@4584 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 17 years ago
parent 5fde618337
commit 19286fa2d1

@ -114,15 +114,12 @@ public class kelondroDyn {
buffer = new kelondroObjectBuffer(file.toString()); buffer = new kelondroObjectBuffer(file.toString());
} }
public static final void delete(File file, boolean usetree) { public static final void delete(File file) {
if (usetree) { if (file.isFile()) {
file.delete(); file.delete();
if (file.exists()) file.deleteOnExit();
} else { } else {
if (file.isDirectory()) { kelondroFlexWidthArray.delete(file.getParentFile(), file.getName());
kelondroFlexWidthArray.delete(file.getParentFile(), file.getName());
} else {
file.delete();
}
} }
} }
@ -199,7 +196,7 @@ public class kelondroDyn {
kelondroRow.Entry nt; kelondroRow.Entry nt;
while (ri.hasNext()) { while (ri.hasNext()) {
nt = (kelondroRow.Entry) ri.next(); nt = (kelondroRow.Entry) ri.next();
if (nt == null) throw new kelondroException("no more elements available"); if (nt == null) return null;
g = nt.getColBytes(0); g = nt.getColBytes(0);
if (g == null) return null; if (g == null) return null;
k = new String(g, 0, keylen); k = new String(g, 0, keylen);

@ -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); return new kelondroMapObjects(new kelondroDyn(seedDBFile, true, true, commonHashLength, 480, '#', kelondroBase64Order.enhancedCoder, usetree, false, true), 500, sortFields, longaccFields, doubleaccFields, initializeHandlerMethod, this);
} catch (Exception e) { } catch (Exception e) {
// try again // 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); return new kelondroMapObjects(new kelondroDyn(seedDBFile, true, true, commonHashLength, 480, '#', kelondroBase64Order.enhancedCoder, usetree, false, true), 500, sortFields, longaccFields, doubleaccFields, initializeHandlerMethod, this);
} }
} }

Loading…
Cancel
Save