FubarDevelopment / FtpServer

Portable FTP server written in .NET
http://fubardevelopment.github.io/FtpServer/
MIT License
482 stars 163 forks source link

Allow the filesystem to inform the FTP client with FTP error codes #52

Closed avonheimburg closed 5 years ago

avonheimburg commented 5 years ago

If a filesystem imposes restrictions on the allowed interactions - e.g. only certain file names are allowed for upload - there is currently no way to cleanly inform the client about it.

This pull request introduces a few exceptions in the Abstractions/FileSystems that the filesystem can throw and that will be caught by the FtpConnection and returned with the corresponding regular ftp return codes. FtpConnection now also reacts to a NotSupportedException by returning a "502 Command not supported" exception.