Search code examples
javaftpvirtual-directoryapache-minamina

Embedded FTP Server: manage virtual directory


Having a Java embedded Apache-Mina FTP Server, how do I set-up virtual directories for users (and/or as a home directory)?

For example, I want to have a virtual home directory for a user, this directory should have 2 virtual ones that point to "real" folders, as follows:
VirFolder1 -> /Users/somePath/Documents
VirFolder2 -> /Users/somePath/Dev

I found no clear documentation regarding it, I tried tinkering with the FileSystemFactory interface, but it's not obvious where to go from there.


Solution

  • Have you considered creating symbolic links in the filesystem?

    Both Windows and Unix should support this.

    For Windows you would use the mklink command if on Windows 7 and above, or download Sysinternals junction for XP and Vista.

    If you need to do it programmatically be careful as this would be a great way to look at files and directories a user shouldn't have access to if your code is hacked.