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將不起作用,它僅適用於文件,不適用於目錄。