Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Transfer file onto a remote server using FTP and SFTP both.

 
ashish jadhav
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi ,
i want to create java application in which javaclass looks at the value of the ftpProtocol attribute and if it says ftp then the file will be transferred via FTP instead of SFTP.

POSSIBLE SOLUTION:
1) Write code in Java using standard FTP classes provided with JDK 1.5.

2) See if the suppliers of pscp.exe have a similar tool for normal FTP and use that.
Possibly use of http://www.ncftp.com/ncftp/doc/ncftpput.html which appears to allow transfer using command line only without needing to create control files.

Can you please advise me easiest possible solution??
or if you have any idea about this type of java application please help me.

Thanking you,
Ashish
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What does this have to do with web services ?

Are you confusing FTP and FTPS ? SFTP has to do with SSH. Quoting the wikipedia entry just in case


SFTP is not FTP run over SSH, but rather a new protocol designed from the ground up by the IETF SECSH working group


Your requirements are vague and a little confusing. Please elaborate a little more on what you want to achieve
 
ashish jadhav
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to create java class that class must continue to support SFTP and also FTP while transfering file.(file e.g. pdf format, xml format).
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
Take a look at the FTPClient class in the Apache Commons Net project/library:
http://commons.apache.org/net/api/org/apache/commons/net/ftp/FTPClient.html
It solves at least the FTP part of your requirements.
Best wishes!
 
ashish jadhav
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Ivan.
I will try and let you know soon..
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic