1

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.

Alon Amir
  • 4,913
  • 9
  • 47
  • 86

1 Answers1

2

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.

Sammy
  • 467
  • 3
  • 13
  • If your code is hacked, then your file system is probably compromised as well, however this idea is simple enough, if there was a clear programmatic way I would've preferred it, but in the meantime I guess it's a possible solution, Thanks! – Alon Amir Oct 15 '15 at 09:34
  • 1
    You're most welcome. Glad to be able to help (even if it's a bit of an ugly kludge) – Sammy Oct 15 '15 at 10:39
  • @Alon Amir - I have this same issue creating a virtual directory in Apache FTP Server - Did you ever manage to do this? or did you use the symlinks? – thonnor Jul 19 '16 at 10:13
  • @thonnor I used symlinks. – Alon Amir Jul 19 '16 at 12:32