mirror of
https://github.com/apache/activemq.git
synced 2025-02-09 03:25:33 +00:00
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.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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public synchronized String toString() {
|
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,6 +87,7 @@ public class DataFile extends LinkedNode<DataFile> implements Comparable<DataFil
|
|||||||
return corruptedBlocks;
|
return corruptedBlocks;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int compareTo(DataFile df) {
|
public int compareTo(DataFile df) {
|
||||||
return dataFileId - df.dataFileId;
|
return dataFileId - df.dataFileId;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user