提交 990ae118 authored 作者: Thomas Mueller's avatar Thomas Mueller

MVStore: use NIO even in Windows when using a file name with drive name.

上级 b5f31478
......@@ -14,6 +14,7 @@ import java.nio.channels.OverlappingFileLockException;
import org.h2.mvstore.cache.FilePathCache;
import org.h2.store.fs.FilePath;
import org.h2.store.fs.FilePathDisk;
import org.h2.store.fs.FilePathEncrypt;
import org.h2.store.fs.FilePathNio;
......@@ -111,12 +112,14 @@ public class FileStore {
* used
*/
public void open(String fileName, boolean readOnly, char[] encryptionKey) {
if (fileName != null && fileName.indexOf(':') < 0) {
if (fileName != null) {
if (FilePath.get(fileName) instanceof FilePathDisk) {
// NIO is used, unless a different file system is specified
// the following line is to ensure the NIO file system is compiled
FilePathNio.class.getName();
fileName = "nio:" + fileName;
}
}
this.fileName = fileName;
FilePath f = FilePath.get(fileName);
FilePath parent = f.getParent();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论