0

Hi,

I would like to FTP a file that only part of the filename is known.
The name is something like “ClimateData2010042207XXXX.xls”
performing the following does not work:

FTPClient client = new FTPClient();
    FileOutputStream fos = null;
    client.connect("ftp.domain.com");
    client.login("admin", "secret");
    String filename = “ClimateData2010042207*.xls”;
    fos = new FileOutputStream(filename);
    client.retrieveFile("/" + filename, fos);
    fos.close();
    client.disconnect();

Please advice,
Yair

3
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by zenfaraad
1

FTP supports a mget command which can be used for retrieving multiple files based on the passed in file name/pattern. Look into your FTP client documentation for such support.

0

Thanks, finaly I have used the wget command line that doing the work.

0

Hi YairHa,

How do you use wget(or mget) with org.apache.commons.net.ftp.FTPClient ?

Thanks
Zen...

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.