3

I've adopted Apache FtpServer as a library of my file sharing app. However I expose that I can set the permission of files/directories.

e.g. I have many files/directories under home directory, but I just want to make only the ~/A/, ~/B/, ~/c.txt and ~/d.mp4 to be accessible via FTP connection.

Obviously it is not a good idea to make a temporary director as client root and copy files into, but there seems to be no built-in solution of Apache FtpServer.

Currently I am considering about implementing a FtpFile class for myself, but I'm still confused and hesitating.

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
Qiang
  • 455
  • 5
  • 15

1 Answers1

2

Create your own implementation of the FileSystemFactory.

Or derive your implementation from the default NativeFileSystemFactory. And change the createFileSystemView method to return only the entries you want.

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
  • That's what I need, thanks, I'm going to make a translate&re-translate of path in the FileSystemView. @Martin – Qiang Feb 08 '17 at 08:19