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:
Timothy A. Bish 2012-11-30 16:15:57 +00:00
parent c6cf88b836
commit 1288df5ad4

View File

@ -20,9 +20,9 @@ import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.io.RandomAccessFile; 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.LinkedNode;
import org.apache.activemq.store.kahadb.disk.util.SequenceSet; import org.apache.activemq.store.kahadb.disk.util.SequenceSet;
import org.apache.activemq.util.IOHelper;
/** /**
* DataFile * DataFile
@ -62,12 +62,13 @@ public class DataFile extends LinkedNode<DataFile> implements Comparable<DataFil
length += size; length += size;
} }
public synchronized String toString() { @Override
public synchronized String toString() {
return file.getName() + " number = " + dataFileId + " , length = " + length; return file.getName() + " number = " + dataFileId + " , length = " + length;
} }
public synchronized RandomAccessFile openRandomAccessFile() throws IOException { 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 { public synchronized void closeRandomAccessFile(RandomAccessFile file) throws IOException {
@ -86,7 +87,8 @@ public class DataFile extends LinkedNode<DataFile> implements Comparable<DataFil
return corruptedBlocks; return corruptedBlocks;
} }
public int compareTo(DataFile df) { @Override
public int compareTo(DataFile df) {
return dataFileId - df.dataFileId; return dataFileId - df.dataFileId;
} }