Guichaguri / MinimalFTP

A lightweight, simple FTP server. Pure Java, no dependencies.
Apache License 2.0
160 stars 45 forks source link

Read Only FTP #11

Closed jomir199 closed 2 years ago

jomir199 commented 2 years ago

Hi, I would like to implement a read only FTP server. How to do this? Do I need to disable some default command or other things?

Thank you.

Guichaguri commented 2 years ago

Hello, sorry for the late response

You just need to extend NativeFileSystem and override write methods such as writeFile, mkdirs, delete, rename, touch and chmod to make them always throw exceptions. All write commands will be rejected.

Then you can create a custom authenticator that will return that NativeFileSystem instance.