This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

FTPSClient - Connection timed out exception  RSS feed

 
Divakar Sashwanth
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I am using apache commons net 2.2's API to create a connection to a secured FTP server and file transfer to and from the FTP server. I am using FTPSClient to achieve this task. IBM JRE - 6

I tried connecting to the FTP server in DOS promt using "sftp username@servername", it succeeded, I was able to download and upload files but the same is not working when I tried with the FTPSClient API.

Below is the code

FTPSClient ftpClient = new FTPSClient();
ftpClient.setDefaultTimeout(100000);
ftpClient.connect("servername"); // It fails here

......



I don't know for what reason this connection is timed out. Can someone please let me know what is the reason for this exception. I tried increasing the timeout, it did not help.

Thanks much
Divakar
 
Rob Spoor
Sheriff
Posts: 20893
81
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
FTPS is not the same as SFTP. You're using two different protocols.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!