I am using version 2.2.2 of the edtftpj Java library inside a JBoss environment and it works well in general. But unfortunately the only way to stop a running download is to call FileTransferClient.cancelAllTransfers() which calls through to FTPClient.cancelTransfer(). This sets an interal flag to true which is checked within the while-loop of the getDataAfterInitGet(OutputStream) method.
In order to stop a running download a separate thread is required. But creating threads in Java EE is bad style and should be avoided.
When the JVM shuts down, all running threads will be interrupt()-ed. Therefore implementations should check isInterrupted() from time to time and cancel whatever they are doing as soon as this method returns true. Could such a check be added to the while-loop (line 3196) in the next version of the library?