Of course, just use CopyStreamListener . Below you will find an example (copied from the commons-io wiki) of extracting files, so you can easily change it in the opposite direction.
try { InputStream stO = new BufferedInputStream( ftp.retrieveFileStream("foo.bar"), ftp.getBufferSize()); OutputStream stD = new FileOutputStream("bar.foo"); org.apache.commons.net.io.Util.copyStream( stO, stD, ftp.getBufferSize(), org.apache.commons.net.io.CopyStreamEvent.UNKNOWN_STREAM_SIZE, new org.apache.commons.net.io.CopyStreamAdapter() { public void bytesTransferred(long totalBytesTransferred, int bytesTransferred, long streamSize) {
source share