commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Mercier <>
Subject Timeout problem with FTPClient
Date Fri, 22 Apr 2005 14:18:24 GMT

I am using FTPClient to connect to a remote FTP Server that seems to
be unreliable.

I have a class (FTPClientControl) that does all the necessary
initializations and has the following procedure:

   public boolean fetchFileNamed(FtpFileTableObject fileName,
FileOutputStream outStream) {
        try {
            // fileName.getFullPath() would be for ex: /home/user/subdir/myfile
            ftpClient.retrieveFile(fileName.getFullPath(), outStream);
        } catch (Exception e) {
            return false;
        return true;

I call the procedure by looping over a predermined list of files that
I know exist on the FTP server.  What happens, is that the app will
freeze trying to download files on occasion.  I have tried a linux
command line client as well as ws-ftp to the same server and have had
the same problems.  I though I had resolved the issue by doing a
logout and login if the above procedure returned false, but it seems
that the procedure sometimes never returns.

Is there a way to setup a timeout on the FTPClient.retrieveFile call
so that I can continue normally?


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message