List of usage examples for org.apache.commons.net.ftp FTPClient removeProtocolCommandListener
public void removeProtocolCommandListener(ProtocolCommandListener listener)
From source file:jenkins.plugins.publish_over_ftp.BapFtpHostConfiguration.java
private void login(final BapFtpClient client, final PrintCommandListener commandListener) throws IOException { final FTPClient ftpClient = client.getFtpClient(); final BPBuildInfo buildInfo = client.getBuildInfo(); if (commandListener != null) { buildInfo.println(Messages.console_logInHidingCommunication()); ftpClient.removeProtocolCommandListener(commandListener); }// w w w .java 2 s . c o m final BapFtpCredentials overrideCredentials = (BapFtpCredentials) buildInfo .get(BPBuildInfo.OVERRIDE_CREDENTIALS_CONTEXT_KEY); final String username = overrideCredentials == null ? getUsername() : overrideCredentials.getUsername(); final String password = overrideCredentials == null ? getPassword() : Secret.toString(overrideCredentials.getPassword()); if (!ftpClient.login(username, password)) { exception(client, Messages.exception_logInFailed(username)); } if (commandListener != null) { buildInfo.println(Messages.console_loggedInShowingCommunication()); ftpClient.addProtocolCommandListener(commandListener); } }