The following code causes the thread to hang until a socket timeout occurs:
FileTransferClient ftpClient = ...create and connect... ;
try (InputStream is = ftpClient.downloadStream("does_not_exist");
OutputStream os = new FileOutputStream(new File(localFileName));) {
IOUtils.copy(is, os);
}
The effect is that IOUtils.copy() fails with an IOException ("com.enterprisedt.net.ftp.FTPException: does_not_exist: No such file or directory") and the try-with-resources subsequently calls FTPInputStream.close() on "is". The FTPInputStream.close() hangs until the socket timeout (default 60s) occurs.
This problem is reproducable with a "FtpTester" tool I built (and I can provide, if desired). The output of the FtpTester tool is here: http://pastebin.com/srPgkJRY - note the timestamps [16/06/02 15:04:57.772 CEST] and [16/06/02 15:05:57.775 CEST] that are 60 seconds apart (socket timeout).
The image "stacktrace.png" shows where the thread hangs after FTPInputStream.close() is called: