Welcome, Guest. Please login or register.
Did you miss your activation email?
Pages: [1]   Go Down
  Print  
Author Topic: Java ftp client, code included  (Read 1282 times)
0 Members and 1 Guest are viewing this topic.
Arkie
Javaforums.net Admin
Senior Member
*

Reputation: 16
Developer @ Javaforums.net
Offline Offline
Posts: 2593
Referrals: 13

WWW Awards
« on: December 24, 2008, 06:30:30 PM »

i've coded a simple java ftp client that you can use to connect to an ftp and download files to your disk. At the moment the features are limited but i'll work on that later if anyone wants me to code more features.

Code
GeSHi (java):
  1. /*--------------------------------------------------------------------------
  2. Main class
  3. *****************
  4. By: deAppel http://www.engineeringserver.com
  5. Contact: info [@] engineeringserver.com
  6. Version: 29/07/2008
  7. "*****************
  8. Note: an FTP console client that download files on a remote server
  9. //----------------------------------------------------------------------*/
  10. public class Main {
  11. public static void main(String[] args){
  12. String userName = "yourUserName";
  13. String userPassword = "yourPassword";
  14. String userHost = "engineeringserver.com";
  15. String userDirectory = "public_html";
  16. System.out.println("Downloading files from: " + userHost + "/" + userDirectory);
  17.  
  18. FilePath FP = new FilePath();
  19. FP.connectToFTPAndSaveStructure(userName,userPassword,userHost,userDirectory);
  20.  
  21. System.out.println("Download finished");
  22. }
  23. }
Created by GeSHI 1.0.7.20
http://img253.imageshack.us/img253/2010/ftpclientgb4.png
Java ftp client, code included


Logged

Java and .NET developer

To students: It doesn't matter how hard you've studied; the material won't be on the exam anyway.

Fan of http://www.retardedweblogger.com
Oh man, too much stuff to do in so little time.

http://img222.imageshack....707/arkietomatoesmall.jpg
Blizzcon 2k9 Grubby and Cassandra Ng engaged ! <3
Triple D, eerste Denken Dan Doen
jazz2k8
Yo Maaan Cheer Up...
Member
*

Reputation: 0
Offline Offline
Posts: 82
Referrals: 0

WWW Awards
« Reply #1 on: January 20, 2009, 09:42:30 AM »

can't we download the directories , instead from a single directory?

System.out.println("Downloading files from: " + userHost + "/" + userDirectory);

if userDirectory is having multiple directories then does it works?? if not can you advice how to solve it.

Logged

visit my blog: www.yoteam.co.cc
Arkie
Javaforums.net Admin
Senior Member
*

Reputation: 16
Developer @ Javaforums.net
Offline Offline
Posts: 2593
Referrals: 13

WWW Awards
« Reply #2 on: January 20, 2009, 10:27:51 AM »

can't we download the directories , instead from a single directory?

System.out.println("Downloading files from: " + userHost + "/" + userDirectory);

if userDirectory is having multiple directories then does it works?? if not can you advice how to solve it.



it's fixed in a later release, i haven't uploaded it yet.
Logged

Java and .NET developer

To students: It doesn't matter how hard you've studied; the material won't be on the exam anyway.

Fan of http://www.retardedweblogger.com
Oh man, too much stuff to do in so little time.

http://img222.imageshack....707/arkietomatoesmall.jpg
Blizzcon 2k9 Grubby and Cassandra Ng engaged ! <3
Triple D, eerste Denken Dan Doen
jazz2k8
Yo Maaan Cheer Up...
Member
*

Reputation: 0
Offline Offline
Posts: 82
Referrals: 0

WWW Awards
« Reply #3 on: January 21, 2009, 06:46:36 AM »

Thnaks for the reply....we will be waiting  for that...
Logged

visit my blog: www.yoteam.co.cc
Pages: [1]   Go Up
  Print  
 
Jump to:  

Your Ad Here