Java FTP Download Example - Apache Commons Net

Today we will look into Java FTP download file example using Apache Commons Net API. Few days back I wrote a post on how to FTP Upload File using Apache Commons Net API. Here we will learn how to use apache commons Net API to download file from FTP server.

Java FTP Download

In above program constructor, we are creating FTP connection and then using downloadFile() method to download the file located on FTP server to local system. FTPClient retrieveFile() method is used to download file from FTP server.

Note that the remote file path should be relative to the FTP user home directory.

Here is the output of the above FTP download file example program.

That’s all for FTP download file example using Apache commons Net API.

By admin

Leave a Reply

%d bloggers like this: