2017-06-01 153 views
0

下面的代码我试图连接使用FTPSClient SFTP主机。而不是FTP客户端,我使用FTPSClient进行连接。但我正面临连接问题。与FTPSClient SFTP连接失败

public static void main(String[] args) throws SocketException, IOException { 
     String host ="sftphost.com"; 
     String user = "abc"; 
     String pwd = "pwd" 
     final FTPSClient ftp = new FTPSClient();   
     System.out.println("host:"+host); 
     ftp.connect(host,22);  
     int reply = ftp.getReplyCode(); 
     ftp.login(user, pwd); 
} 

回答