Waarp FTP

The Waarp project starts with a new fresh FTP(S) server implementation, fully in Java according to the following RFC:

It includes also the following extra commands from version 0.9.2:

  • XCRC to compute CRC on a remote file
  • XMD5 to compute MD5 on a remote file
  • XSHA1 to compute SHA-1 on a remote file

  • INTERNALSHUTDOWN to allow to shutdown the server (protected command)

It is based mainly on the NETTY framework (NIO great framework support) and is tend to be really efficient, both in term of memory, threads and network bandwidth. Bandwidth limitation can be configured both in store and retrieve, per session (although only one value is set by default, but it can be changed dynamically if needed) or globally to the server and of course with no limitation at all if wanted. Limitation should be enough to change the bandwidth behaviour for instance depending on the time in the day, so as to allow to limit bandwidth usage when users are at work and in contrary to allow more speed when only batchs are running.

 

The specificity of this project is that you can adapt this software to your particular needs by:

  • changing the pre or post action on commands (not ony transfer),
  • changing the underlying representation of files and directories (for instance with database entries),
  • using any particular authentication mechanism.

 

Currently this FTP Server handle the following implementations but you can extend it to fit your needs:

  • File and Directory can be true File and Directory (default version), but they can also be something else, for instance data from database, from LDAP or whatever you want, as long as you can implement the interface (DirInterface and FileInterface).
  • Authentication can be whatever you want: file based (default version), or others like database, LDAP or whatever you want, as long as you can implement the interface (AuthInterface)
  • Actions on pre or post commands can be configured from 2 classes, one business from control connection and one business from data connection (abstract classes BusinessNetworkHandler and DataBusinessNetworkHandler)
  • Logger can be setup as you want: SLF4J (default using LOGBACK) or whatever you want, as long as you can implement the abstract classes (FtpInternalLogger and FtpInternalLoggerFactory)

So at most, if you want to implement all new, you will have to implement only 7 classes, plus of course the main class one that will launch the server itself.

 

If you just want a simple FTP Server, then you've just have to instantiate the main class and reused the default implementation that is proposed. The SimpleImpl package shows one example.

 

Extending the server should not be difficult. For instance, adding a new command is as easy as:

  • Create a new class that extends the AbstractCommand class
  • Add a reference to it into the FtpCommandCode class

That's it!

 

Adding a new response code is even easier, you have just to add an entry in FtpReplyCode class.

 

From version 1.1.2, FTP server allows SSL support (FTPS) both as Implicit (native SSL/TLS support on wire level) and Explicit (using commands such as AUTH and PROT).

 

This project is in production in the French Ministery of Finances to enable file transfers from an FTP protocol (client side) to an Waarp R66 protocol (server side protocol) since end of 2007.

 

Feel free to test it, ask me or make any feedback you wanted on this project. It will be my pleasure!