提交 2684342d authored 作者: Thomas Mueller's avatar Thomas Mueller

The zip file system implementation now supports the '~' home directory prefix.

上级 812c3ffb
...@@ -16,6 +16,7 @@ import java.util.Enumeration; ...@@ -16,6 +16,7 @@ import java.util.Enumeration;
import java.util.zip.ZipEntry; import java.util.zip.ZipEntry;
import java.util.zip.ZipFile; import java.util.zip.ZipFile;
import org.h2.constant.SysProperties;
import org.h2.message.Message; import org.h2.message.Message;
import org.h2.util.New; import org.h2.util.New;
...@@ -229,6 +230,10 @@ public class FileSystemZip extends FileSystem { ...@@ -229,6 +230,10 @@ public class FileSystemZip extends FileSystem {
if (idx >= 0) { if (idx >= 0) {
fileName = fileName.substring(0, idx); fileName = fileName.substring(0, idx);
} }
if (fileName.startsWith("~")) {
String userDir = SysProperties.USER_HOME;
fileName = userDir + fileName.substring(1);
}
return fileName; return fileName;
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论