Example usage for org.apache.commons.net.ftp FTPSClient setUseClientMode

List of usage examples for org.apache.commons.net.ftp FTPSClient setUseClientMode

Introduction

In this page you can find the example usage for org.apache.commons.net.ftp FTPSClient setUseClientMode.

Prototype

public void setUseClientMode(boolean isClientMode) 

Source Link

Document

Configures the socket to use client (or server) mode in its first handshake.

Usage

From source file:org.springframework.integration.ftp.session.DefaultFtpsSessionFactory.java

@Override
protected void postProcessClientBeforeConnect(FTPSClient ftpsClient) throws IOException {
    if (StringUtils.hasText(this.authValue)) {
        ftpsClient.setAuthValue(authValue);
    }/* w  ww  . j ava2 s . co m*/
    if (this.trustManager != null) {
        ftpsClient.setTrustManager(this.trustManager);
    }
    if (this.cipherSuites != null) {
        ftpsClient.setEnabledCipherSuites(this.cipherSuites);
    }
    if (this.protocols != null) {
        ftpsClient.setEnabledProtocols(this.protocols);
    }
    if (this.sessionCreation != null) {
        ftpsClient.setEnabledSessionCreation(this.sessionCreation);
    }
    if (this.useClientMode != null) {
        ftpsClient.setUseClientMode(this.useClientMode);
    }
    if (this.sessionCreation != null) {
        ftpsClient.setEnabledSessionCreation(this.sessionCreation);
    }
    if (this.keyManager != null) {
        ftpsClient.setKeyManager(keyManager);
    }
    if (this.needClientAuth != null) {
        ftpsClient.setNeedClientAuth(this.needClientAuth);
    }
    if (this.wantsClientAuth != null) {
        ftpsClient.setWantClientAuth(this.wantsClientAuth);
    }
}

From source file:org.teiid.resource.adapter.ftp.FtpManagedConnectionFactory.java

private void afterConnectProcessing(FTPClient client) throws IOException {

    if (this.parentDirectory == null) {
        throw new IOException(UTIL.getString("parentdirectory_not_set")); //$NON-NLS-1$
    }/*from   w w  w.j  av  a  2  s .  co m*/

    if (!client.changeWorkingDirectory(this.getParentDirectory())) {
        throw new IOException(UTIL.getString("ftp_dir_not_exist", this.getParentDirectory())); //$NON-NLS-1$
    }

    updateClientMode(client);

    client.setFileType(this.fileType);
    client.setBufferSize(this.bufferSize);

    if (this.isFtps) {
        FTPSClient ftpsClient = (FTPSClient) client;
        if (this.getAuthValue() != null) {
            ftpsClient.setAuthValue(this.authValue);
        }
        if (this.trustManager != null) {
            ftpsClient.setTrustManager(this.trustManager);
        }
        if (this.cipherSuites != null) {
            ftpsClient.setEnabledCipherSuites(this.cipherSuites);
        }
        if (this.protocols != null) {
            ftpsClient.setEnabledProtocols(this.protocols);
        }
        if (this.sessionCreation != null) {
            ftpsClient.setEnabledSessionCreation(this.sessionCreation);
        }
        if (this.useClientMode != null) {
            ftpsClient.setUseClientMode(this.useClientMode);
        }
        if (this.sessionCreation != null) {
            ftpsClient.setEnabledSessionCreation(this.sessionCreation);
        }
        if (this.keyManager != null) {
            ftpsClient.setKeyManager(this.keyManager);
        }
        if (this.needClientAuth != null) {
            ftpsClient.setNeedClientAuth(this.needClientAuth);
        }
        if (this.wantsClientAuth != null) {
            ftpsClient.setWantClientAuth(this.wantsClientAuth);
        }
    }
}

From source file:org.teiid.test.teiid4441.FTPClientFactory.java

private void afterConnectProcessing(FTPClient client) throws IOException {

    if (this.parentDirectory == null) {
        throw new IOException("parentdirectory_not_set");
    }//  w  ww  . j  ava  2  s . c  o m

    if (!client.changeWorkingDirectory(this.getParentDirectory())) {
        throw new IOException("ftp_dir_not_exist");
    }

    updateClientMode(client);

    client.setFileType(this.fileType);
    client.setBufferSize(this.bufferSize);

    if (this.isFtps) {
        FTPSClient ftpsClient = (FTPSClient) client;
        if (this.getAuthValue() != null) {
            ftpsClient.setAuthValue(this.authValue);
        }
        if (this.trustManager != null) {
            ftpsClient.setTrustManager(this.trustManager);
        }
        if (this.cipherSuites != null) {
            ftpsClient.setEnabledCipherSuites(this.cipherSuites);
        }
        if (this.protocols != null) {
            ftpsClient.setEnabledProtocols(this.protocols);
        }
        if (this.sessionCreation != null) {
            ftpsClient.setEnabledSessionCreation(this.sessionCreation);
        }
        if (this.useClientMode != null) {
            ftpsClient.setUseClientMode(this.useClientMode);
        }
        if (this.sessionCreation != null) {
            ftpsClient.setEnabledSessionCreation(this.sessionCreation);
        }
        if (this.keyManager != null) {
            ftpsClient.setKeyManager(this.keyManager);
        }
        if (this.needClientAuth != null) {
            ftpsClient.setNeedClientAuth(this.needClientAuth);
        }
        if (this.wantsClientAuth != null) {
            ftpsClient.setWantClientAuth(this.wantsClientAuth);
        }
    }
}