@Override protected TransferListener addListener( int progressEventNumber ) { SynchronizationFtpTransferListener listener = new SynchronizationFtpTransferListener(this, progressEventNumber); this.ftpsConnection.addProtocolCommandListener(listener); return listener; }
@Override public void enableResponseCollection( boolean enable ) { if (enable) { this.listener = new FtpResponseListener(); // If it's connected add the listener to gather the responses if (this.ftpsConnection != null) { this.ftpsConnection.addProtocolCommandListener((FtpResponseListener) listener); } } else { // If it's connected remove the listener if (this.ftpsConnection != null) { this.ftpsConnection.removeProtocolCommandListener((FtpResponseListener) listener); } this.listener = null; } }
this.ftpsConnection.addProtocolCommandListener( ((FtpResponseListener) listener)); this.ftpsConnection.addProtocolCommandListener(new FtpListener());
FTPSClient ftpClient = new FTPSClient("tls",false); ftpClient.addProtocolCommandListener(new PrintCommandListener(new PrintWriter(System.out))); ftpClient.connect(host, port); int reply = ftpClient.getReplyCode(); if (FTPReply.isPositiveCompletion(reply)) { ftpClient.execPBSZ(0); reply = ftpClient.getReplyCode(); // Check for PBSZ error responses... ftpClient.execPROT("P"); reply = ftpClient.getReplyCode(); // Check for PROT error responses... ftpClient.enterLocalPassiveMode();
FTPSClient l_ftp = new FTPSClient("SSL", false); l_ftp.addProtocolCommandListener(new PrintCommandListener(new PrintWriter(System.out))); l_ftp.setAuthValue("SSL"); l_ftp.connect(l_host, l_port); if (!l_ftp.login(l_username, l_password)) { // BAD! } l_ftp.execPBSZ(0L); l_ftp.execCCC(); l_ftp.pwd(); // DO STUFF l_ftp.logout(); l_ftp.disconnect();