0
我尝试使用相对路径来获取文件夹的使用Apache VFS的父母,但我得到“无效的相对路径”Apache的VFS相对路径
public static void main(String[] args) throws Exception {
FileSystemManager fileSystemManager = VFS.getManager();
FileObject fileObject = fileSystemManager
.resolveFile("sftp://myuser:[email protected]/"); // works!!
FileObject root = fileObject.resolveFile("../"); // fails!!
FileObject fileObjects[] = root.getChildren();
...
我尝试“/ ..”,“/../”为好吧,都有异常。父目录的正确路径是什么?
P.S #getParent将不起作用,它仅适用于文件,不适用于目录。