commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel F. Savarese" <...@savarese.org>
Subject Re: FTPClient hangs when downloading large files
Date Wed, 16 Feb 2011 01:43:33 GMT

In message <56FC94A3326C66468CE73D751286FF23496064@nawespscez02v.nadsuswe.nads.
navy.mil>, "Cysneros, Nelson A CIV SPAWARSYSCEN-PACIFIC, 56540" writes:
>I'm using the net-commons v2.2 FTPClient to download files from a server
>and it works great for files less then 250MB, but hangs with larger
>files.
...
>ftpClient.retrieveFile(ftpPath + "/" + files[i].getName(),fos); //Hangs here

Try using retrieveFileStream and writing your own stream-copying loop
(it should be only a few lines of code; but don't forget to call
completePendingCommand afterward).  If it works, then there's
something wrong with org.apache.commons.net.io.Util.copyStream.  If
you still experience a mysterious hang, then it's probably
not a Commons Net issue, but something to do with the network
environment.

daniel


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Mime
View raw message