JFileChooser browsing a remote file system

ε祈祈猫儿з 提交于 2019-12-29 09:30:09

问题


I am trying to Implement a JFileChooser that allows a user to select files on a remote system via ftp.

Everything I've read says this can be accomplished by extending FileSystemView so that all the file system methods (getFiles, etc) are overridden and routed across ftp.

I haven't had any luck implementing this, as FileSystemView appears to still be calling local functions.

Can anyone confirm that this can be done and/or point me in a good direction?


回答1:


Try vfsjfilechooser




回答2:


If you want to implement your own FileSystemView and prevent access to the local file systems, you must of course override all methods or at least getSystemDisplayName and all the is* methods. Another problem is of course that the FileSystemView interface is closely linked to the File class, so it may not be trivial to provide a non-file-based implementation.




回答3:


I am pretty sure this could be done. For a starter you could check out how the author of MediaChest (aka PhotoOrganizer) has done it.

Discovered the relevant code files here Codase: FtpFileSystemView



来源:https://stackoverflow.com/questions/1732179/jfilechooser-browsing-a-remote-file-system

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!