Win a copy of Murach's MySQL this week in the JDBC and Relational Databases forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Download folders from FTP server

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic