Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
2.9k views
in Java FTP by (120 points)
Im using version 2.0 of the jar and trying to get a directory listing. However, the listing is timing out due to this particular external site having a TON of files in one folder. I can do it command line, you just have to wait a few minutes for it to return.

I've tried setting the ftp.setTimeout to a large number, but I think that may be the connect timeout, not a timeout for how long to wait for a dir listing.
Is there a way to increase the timeout value for a directory listing?

Thanks,
Jeff

p.s. here is a snippet:
                          FTPClient ftp =null;
               ftp = new FTPClient();
               ftp.setRemoteHost(serverName);
               ftp.setRemotePort(port);
               listener = new FTPMessageCollector();
               ftp.setMessageListener(listener);
               ftp.connect();
               ftp.login(username, password);
               ftp.setTimeout(160000);
                         ftp.setConnectMode(FTPConnectMode.PASV);
               ftp.chdir(dir);
               FTPFile[] finfo = ftp.dirDetails(dir);


The last line is where it's timing out.

1 Answer

0 votes
by (162k points)
The timeout is in ms, so you need to set it to something like 5*60*1000 for a 5 minute timeout.

Categories

...