提交 a1ace544 authored 作者: Thomas Mueller's avatar Thomas Mueller

The in-memory file system "memFS:" now has limitted support for directories.

上级 848c4a28
...@@ -44,6 +44,7 @@ public class TestFileSystem extends TestBase { ...@@ -44,6 +44,7 @@ public class TestFileSystem extends TestBase {
} }
public void test() throws Exception { public void test() throws Exception {
testMemFsDir();
testClasspath(); testClasspath();
FileSystemCrypt.register(); FileSystemCrypt.register();
// DebugFileSystem.register().setTrace(true); // DebugFileSystem.register().setTrace(true);
...@@ -83,6 +84,15 @@ public class TestFileSystem extends TestBase { ...@@ -83,6 +84,15 @@ public class TestFileSystem extends TestBase {
} }
} }
private void testMemFsDir() throws IOException {
String dir = "memFS:data/test";
FileSystem fs = FileSystem.getInstance(dir);
fs.openFileOutputStream("memFS:data/test/a.txt", false).close();
String[] list = fs.listFiles("memFS:data/test");
assertEquals(1, list.length);
fs.deleteRecursive("memFS:", false);
}
private void testClasspath() throws IOException { private void testClasspath() throws IOException {
String resource = "org/h2/test/testSimple.in.txt"; String resource = "org/h2/test/testSimple.in.txt";
InputStream in; InputStream in;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论