Skip to content

Commit

Permalink
accept also files with other file prefix; used to read 'foreign' cache
Browse files Browse the repository at this point in the history
files
  • Loading branch information
Orbiter committed Jun 6, 2012
1 parent 96c8119 commit 6bb07af
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions source/net/yacy/kelondro/blob/ArrayStack.java
Expand Up @@ -128,7 +128,7 @@ public ArrayStack(
Runtime.getRuntime().availableProcessors(), 100,
TimeUnit.MILLISECONDS,
new LinkedBlockingQueue<Runnable>(),
new NamePrefixThreadFactory(prefix));
new NamePrefixThreadFactory(this.prefix));

// check existence of the heap directory
if (heapLocation.exists()) {
Expand Down Expand Up @@ -183,9 +183,9 @@ public ArrayStack(
File f;
long maxtime = 0;
for (final String file : files) {
if (file.length() >= 22 && file.startsWith(prefix) && file.endsWith(".blob")) {
if (file.length() >= 22 && file.charAt(this.prefix.length()) == '.' && file.endsWith(".blob")) {
try {
d = my_SHORT_MILSEC_FORMATTER.parse(file.substring(prefix.length() + 1, prefix.length() + 18));
d = my_SHORT_MILSEC_FORMATTER.parse(file.substring(this.prefix.length() + 1, this.prefix.length() + 18));
time = d.getTime();
if (time > maxtime) maxtime = time;
} catch (final ParseException e) {continue;}
Expand All @@ -194,9 +194,9 @@ public ArrayStack(

// open all blob files
for (final String file : files) {
if (file.length() >= 22 && file.startsWith(prefix) && file.endsWith(".blob")) {
if (file.length() >= 22 && file.charAt(this.prefix.length()) == '.' && file.endsWith(".blob")) {
try {
d = my_SHORT_MILSEC_FORMATTER.parse(file.substring(prefix.length() + 1, prefix.length() + 18));
d = my_SHORT_MILSEC_FORMATTER.parse(file.substring(this.prefix.length() + 1, this.prefix.length() + 18));
f = new File(heapLocation, file);
time = d.getTime();
if (time == maxtime && !trimall) {
Expand Down

0 comments on commit 6bb07af

Please sign in to comment.