Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

fix for Table in case that requested file does not exist and paths also do not exist

Michael Peter Christen1aea01fe5ba3
diff --git a/source/net/yacy/kelondro/table/Table.java b/source/net/yacy/kelondro/table/Table.java
index ed67e398e..8630f35d2 100644
--- a/source/net/yacy/kelondro/table/Table.java
+++ b/source/net/yacy/kelondro/table/Table.java
@@ -109,6 +109,7 @@ public class Table implements Index, Iterable<Row.Entry> {
// make new file
freshFile = true;
FileOutputStream fos = null;
+ tablefile.getParentFile().mkdirs();
try {
fos = new FileOutputStream(tablefile);
} catch (final FileNotFoundException e) {
@@ -365,7 +366,7 @@ public class Table implements Index, Iterable<Row.Entry> {
try {
return this.file.size() == this.index.size();
} catch (final IOException e) {
- log.logException(e);
+ ConcurrentLog.logException(e);
return false;
}
}
@@ -761,7 +762,7 @@ public class Table implements Index, Iterable<Row.Entry> {
try {
this.index.put(k, i);
} catch (final SpaceExceededException e) {
- log.logException(e);
+ ConcurrentLog.logException(e);
throw new IOException("RowSpaceExceededException: " + e.getMessage());
}
}
@@ -791,7 +792,7 @@ public class Table implements Index, Iterable<Row.Entry> {
try {
this.table.set(i, te);
} catch (final SpaceExceededException e) {
- log.logException(e);
+ ConcurrentLog.logException(e);
this.table = null;
}
@@ -1118,7 +1119,7 @@ public class Table implements Index, Iterable<Row.Entry> {
}
System.out.println("FINISHED test after " + ((System.currentTimeMillis() - start) / 1000) + " seconds.");
} catch (final Exception e) {
- log.logException(e);
+ ConcurrentLog.logException(e);
System.out.println("TERMINATED");
}
}