mirror of https://github.com/apache/activemq.git
use the getCanonicalPath() value to ensure valid pathnames being used on the platform. git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1415725 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
c6cf88b836
commit
1288df5ad4
|
@ -20,9 +20,9 @@ import java.io.File;
|
|||
import java.io.IOException;
|
||||
import java.io.RandomAccessFile;
|
||||
|
||||
import org.apache.activemq.util.IOHelper;
|
||||
import org.apache.activemq.store.kahadb.disk.util.LinkedNode;
|
||||
import org.apache.activemq.store.kahadb.disk.util.SequenceSet;
|
||||
import org.apache.activemq.util.IOHelper;
|
||||
|
||||
/**
|
||||
* DataFile
|
||||
|
@ -62,12 +62,13 @@ public class DataFile extends LinkedNode<DataFile> implements Comparable<DataFil
|
|||
length += size;
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized String toString() {
|
||||
return file.getName() + " number = " + dataFileId + " , length = " + length;
|
||||
}
|
||||
|
||||
public synchronized RandomAccessFile openRandomAccessFile() throws IOException {
|
||||
return new RandomAccessFile(file, "rw");
|
||||
return new RandomAccessFile(file.getCanonicalPath(), "rw");
|
||||
}
|
||||
|
||||
public synchronized void closeRandomAccessFile(RandomAccessFile file) throws IOException {
|
||||
|
@ -86,6 +87,7 @@ public class DataFile extends LinkedNode<DataFile> implements Comparable<DataFil
|
|||
return corruptedBlocks;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(DataFile df) {
|
||||
return dataFileId - df.dataFileId;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue