Hi, I want to download a set of folders recursively from an ftp server. I have downloaded a jar file from net,but it's licence got expired. Can anybody tell me how to do this? Is there any other sites available from where i can download ftp code. I have got a lot of sites using which i can download only a file not the folders recursively. I want this program to run as system scheduled task. Is there any better ways of doing this? Help me. Thanks Shiva
I will get you halfway. This code will print a directory on an FTP server to stdout:
The results look something like this:
Check each line as you get it. If it begins with a "d" it's a "directory" If it begins with a "-" it's a file ("l" is a symbolic link, you may want to follow them or not). Hop to the end of the line for the file/directory name. If it's a file, copy it to your local drive. If it's a directory, append it to the end of the URL you used previously and get it's directory listing (don't forget to create it locally as well!). Repeat for every directy you find and you get the whole tree.