English 中文(简体)
JFileChooser browsing a remote file system
原标题:

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?

最佳回答
问题回答

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.

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





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签