Well, I'm not quite sure what you mean by “download”. To receive something via FTP, you must issue an FTP GET command, which will open a stream to your client and begin sending bytes of the requested file through this stream. Now most FTP clients collect all these bytes and write them to a file on the local disk, but you can make Java code that does not execute this last part, instead you can write bytes in memory or parse them when they come in and discard some of them etc.
And yes, I understand that I am not giving you exact instructions on how to use the clean Apache commons library for this, because I believe that you must first understand the basics of what you are trying to do before you start using the library, which makes an abstraction on top of everything.
Check out basic FTP operations:
http://www.cs.colostate.edu/helpdocs/ftp.html
and the basics of Java I / O:
http://download.oracle.com/javase/tutorial/essential/io/
Shivan Dragon 07 Oct 2018-11-11T00: 00Z
source share