I have just download the latest version and import the source code into my projcect
Please notice the following code in FTPClient.java from Line 2598
private String putStream(InputStream srcStream, String remoteFile, boolean append)
throws IOException, FTPException {
try {
if (monitorEx != null)
monitorEx.transferStarted(TransferDirection.UPLOAD, remoteFile);
remoteFile = putData(srcStream, remoteFile, append);
validateTransfer();
uploadCount++;
}
catch (FTPException ex) {
throw ex;
}
catch (ControlChannelIOException ex) {
throw ex;
}
catch (IOException ex) {
validateTransferOnError(ex);
throw ex;
}
finally {
if (monitorEx != null)
monitorEx.transferComplete(TransferDirection.UPLOAD, remoteFile);
}
return remoteFile;
}
Please notice the last finally block, which call transferComplete even an exception is catched during the transfer.
In fact, after I turn down the ftp server by force during transfer, an IOException is caught, but due to the finally block, the listener's transferComplete is called.