Discuss (FTP) and (SFTP, FTPS and SCP), our Java file transfer clients.

Download file problem

no avatar
User

wide

Posts

2

Joined

Sat Jun 20, 2009 12:08 am

Download file problem

by wide » Sat Jun 20, 2009 12:24 am

i want to download a directory but i have a problem.
public static void FileDownload(String targetdir, String savedir, FileTransferClient ftp) throws FTPException, IOException {
String[] save = getDir(targetdir, "/");
String folderOrFile;

for (int i = 0; i < save.length; i++) {
folderOrFile = save[i];
if (folderOrFile.equals(save[save.length - 1])) {
ftp.downloadFile(savedir, folderOrFile);
} else {
ftp.changeDirectory(folderOrFile);
}
}
}
it works if targetdir is "/conf/svnserve.conf" but i want to download server a directory for example "/conf/"
no avatar
User

support2

Posts

3987

Joined

Tue May 18, 2004 8:30 am

Re: Download file problem

by support2 » Sat Jun 20, 2009 10:11 am

edtFTPj doesn't have an API for downloading a directory - you would have to implement it yourself.

See for a product with a directory transfer API.

Who is online

Users browsing this forum: No registered users and 19 guests

Powered by phpBB ® | phpBB3 Style by KomiDesign