mirror of https://github.com/apache/activemq.git
if the container name has '/' in it then make sure we create the parent directories before we try to access the file.
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@573392 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
1301501a0a
commit
838e9a42b4
|
@ -177,6 +177,7 @@ public final class IndexManager {
|
||||||
|
|
||||||
protected void initialize() throws IOException {
|
protected void initialize() throws IOException {
|
||||||
file = new File(directory, NAME_PREFIX + IOHelper.toFileSystemSafeName(name) );
|
file = new File(directory, NAME_PREFIX + IOHelper.toFileSystemSafeName(name) );
|
||||||
|
file.getParentFile().mkdirs();
|
||||||
indexFile = new RandomAccessFile(file, mode);
|
indexFile = new RandomAccessFile(file, mode);
|
||||||
reader = new StoreIndexReader(indexFile);
|
reader = new StoreIndexReader(indexFile);
|
||||||
writer = new StoreIndexWriter(indexFile, name, redoLog);
|
writer = new StoreIndexWriter(indexFile, name, redoLog);
|
||||||
|
|
|
@ -392,6 +392,7 @@ public class HashIndex implements Index {
|
||||||
private void openIndexFile() throws IOException {
|
private void openIndexFile() throws IOException {
|
||||||
if (indexFile == null) {
|
if (indexFile == null) {
|
||||||
file = new File(directory, NAME_PREFIX + IOHelper.toFileSystemSafeName(name));
|
file = new File(directory, NAME_PREFIX + IOHelper.toFileSystemSafeName(name));
|
||||||
|
file.getParentFile().mkdirs();
|
||||||
indexFile = new RandomAccessFile(file, "rw");
|
indexFile = new RandomAccessFile(file, "rw");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -407,6 +407,7 @@ public class TreeIndex implements Index {
|
||||||
protected void openIndexFile() throws IOException {
|
protected void openIndexFile() throws IOException {
|
||||||
if (indexFile == null) {
|
if (indexFile == null) {
|
||||||
file = new File(directory, NAME_PREFIX + IOHelper.toFileSystemSafeName(name));
|
file = new File(directory, NAME_PREFIX + IOHelper.toFileSystemSafeName(name));
|
||||||
|
file.getParentFile().mkdirs();
|
||||||
indexFile = new RandomAccessFile(file, "rw");
|
indexFile = new RandomAccessFile(file, "rw");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue