PDA

View Full Version : Retrieve a set of files from a remote directory


shashi2309
01-13-2009, 11:39 AM
Hi,

I want to know that whether do we have any direct API method wherein we can retrieve set of files recursively from a remote directory.

Example.
Remote Dir structure

DIR1

File.txt
DIR2
File1.txt
DIR3
File2.txt


Local Dir structure



LDIR1

File.txt
File1.txt
File2.txt

If I want to retrieve all *.txt from the remote dir DIR1 in recursive mode (searching all subdirectories) and then put the files in a flat structure on the local side in LDIR1

I know we have downloadDir which downloads remote directory and contents recursively from FTP server but in this the downloads are stored relative to current local directory.

Please suggest.

vglass
01-13-2009, 01:19 PM
Prior to doing downloadDir just invoke the Ftp.setLocalDir method.

e.g.

ftp.setLocalDir(new File("c:/ldir1"));

vglass
01-13-2009, 01:30 PM
Upon second glance at your request, there is not a way to do this using a single method call. To do this you will need to traverse the remote directories manually and use the mdownload() method to retrieve files.

D.daura
11-29-2009, 08:10 AM
Please submit a ticket with all of the relevant information so that we can take a look.