JavaFTP - Displaying a custom file structure

Question:

How do you make a custom file structure to show it to the user in the FTP client? The custom file structure is a abstract view just for the user.


Answer:
You'll need to provide your own custom FileSystemFactory that returns
a custom FileSystemView
(http://svn.apache.org/viewvc/mina/ftpserver/trunk/ftplet-api/src/main/java/org/apache/ftpserver/ftplet/FileSystemView.java?view=markup)

The FileSystemView should return your custom FtpFile subclass, which
will limit what gets shown in the listFiles() call.

you then specify your factory in the FTP server configuration (we do
it vai Spring) and all the directory listing/file access calls are
channeled through your custom File/FileSystemView so you can control
what gets shown to the user.

你可能感兴趣的:(JavaFTP - Displaying a custom file structure)