Class FtpSession
java.lang.Object
org.frankframework.filesystem.ftp.FtpSession
- All Implemented Interfaces:
HasApplicationContext,IConfigurable,IScopeProvider,HasKeystore,HasTruststore
- Direct Known Subclasses:
FtpFileSystem
Base class for FTP(s) connections
- Author:
- John Dekker
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic enumstatic enumstatic enum -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()protected static voidclose(org.apache.commons.net.ftp.FTPClient ftpClient) voidConfigure this component.org.apache.commons.net.ftp.FTPClientopenClient(String remoteDirectory) voidsetAllowSelfSignedCertificates(boolean b) (ftps) Iftrue, self signed certificates are acceptedvoidsetAuthAlias(String string) Name of the alias to obtain credentials to authenticatie on remote servervoidsetFileType(FtpSession.FileType value) voidsetFtpType(FtpSession.FtpType value) FTP protocol to usevoidName or ip address of remote hostvoidsetIgnoreCertificateExpiredException(boolean b) (ftps) Iftrue, CertificateExpiredExceptions are ignoredvoidsetKeyManagerAlgorithm(String keyManagerAlgorithm) (ftps) Key manager algorithm.voidsetKeystore(String string) (ftps) Resource url to keystore or certificate to be used for authentication.voidsetKeystoreAlias(String string) (ftps) Alias to obtain specific certificate or key in keystorevoidsetKeystoreAliasAuthAlias(String string) (ftps) Authentication alias to authenticate access to certificate or key indicated bykeystoreAliasvoidsetKeystoreAliasPassword(String string) (ftps) Default password to authenticate access to certificate or key indicated bykeystoreAliasvoidsetKeystoreAuthAlias(String string) (ftps) Authentication alias used to obtain keystore passwordvoidsetKeystorePassword(String string) (ftps) Default password to access keystorevoidsetKeystoreType(KeystoreType value) (ftps) Type of keystorevoidsetPassive(boolean b) Iftrue, passive ftp is used: before data is sent, a pasv command is issued, and the connection is set up by the servervoidsetPassword(String string) Password to authenticatie on remote servervoidsetPort(int i) Port number of remote hostvoidsetProt(FtpSession.Prot prot) Sets theData Channel Protection Level.voidsetProxyHost(String string) Proxy hostnamevoidsetProxyPort(int i) Proxy portvoid(ftps) Transport type in case of sftpvoidsetTrustManagerAlgorithm(String trustManagerAlgorithm) (ftps) Trust manager algorithm.voidsetTruststore(String string) (ftps) Resource url to truststore to be used for authenticating peer.voidsetTruststoreAuthAlias(String string) (ftps) Authentication alias used to obtain truststore passwordvoidsetTruststorePassword(String string) (ftps) Default password to access truststorevoidsetTruststoreType(KeystoreType value) (ftps) Type of truststorevoidsetUsername(String string) Name of the user to authenticatie on remote servervoidsetVerifyHostname(boolean b) (ftps) Iftrue, the hostname in the certificate will be checked against the actual hostname of the peerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.frankframework.core.HasApplicationContext
getApplicationContext, getConfigurationClassLoaderMethods inherited from interface org.frankframework.encryption.HasKeystore
getKeyManagerAlgorithm, getKeystore, getKeystoreAlias, getKeystoreAliasAuthAlias, getKeystoreAliasPassword, getKeystoreAuthAlias, getKeystorePassword, getKeystoreTypeMethods inherited from interface org.frankframework.encryption.HasTruststore
getTrustManagerAlgorithm, getTruststore, getTruststoreAuthAlias, getTruststorePassword, getTruststoreType, isAllowSelfSignedCertificates, isIgnoreCertificateExpiredException, isVerifyHostname
-
Constructor Details
-
FtpSession
public FtpSession()
-
-
Method Details
-
configure
Description copied from interface:IConfigurableConfigure this component.configure()is called once at startup of the framework in the configure method of the owner of thisIConfigurable. Purpose of this method is to check whether the static configuration of the object is correct. As much as possible class-instantiating should take place in theconfigure(), to improve performance.In the case of a container, this will propagate the configure signal to all components that apply.
- Specified by:
configurein interfaceIConfigurable- Throws:
ConfigurationException- in case it was not able to configure the component.
-
openClient
public org.apache.commons.net.ftp.FTPClient openClient(String remoteDirectory) throws FileSystemException - Throws:
FileSystemException
-
close
protected static void close(org.apache.commons.net.ftp.FTPClient ftpClient) -
close
public void close() -
setHost
Name or ip address of remote host -
setPort
public void setPort(int i) Port number of remote host- Default value
- 21
-
setAuthAlias
Name of the alias to obtain credentials to authenticatie on remote server -
setUsername
Name of the user to authenticatie on remote server -
setPassword
Password to authenticatie on remote server -
setProxyHost
Proxy hostname -
setProxyPort
public void setProxyPort(int i) Proxy port- Default value
- 1080
-
setFtpType
FTP protocol to use- Default value
- FTP
-
setFileType
-
setPassive
public void setPassive(boolean b) Iftrue, passive ftp is used: before data is sent, a pasv command is issued, and the connection is set up by the server- Default value
- true
-
setProxyTransportType
(ftps) Transport type in case of sftp- Default value
- SOCKS5
-
setKeystore
(ftps) Resource url to keystore or certificate to be used for authentication. If none specified, the JVMs default keystore will be used.- Specified by:
setKeystorein interfaceHasKeystore
-
setKeystoreType
(ftps) Type of keystore- Specified by:
setKeystoreTypein interfaceHasKeystore- Default value
- pkcs12
-
setKeystoreAuthAlias
(ftps) Authentication alias used to obtain keystore password- Specified by:
setKeystoreAuthAliasin interfaceHasKeystore
-
setKeystorePassword
(ftps) Default password to access keystore- Specified by:
setKeystorePasswordin interfaceHasKeystore
-
setKeyManagerAlgorithm
(ftps) Key manager algorithm. Can be left empty to use the servers default algorithm- Specified by:
setKeyManagerAlgorithmin interfaceHasKeystore
-
setKeystoreAlias
(ftps) Alias to obtain specific certificate or key in keystore- Specified by:
setKeystoreAliasin interfaceHasKeystore
-
setKeystoreAliasAuthAlias
(ftps) Authentication alias to authenticate access to certificate or key indicated bykeystoreAlias- Specified by:
setKeystoreAliasAuthAliasin interfaceHasKeystore
-
setKeystoreAliasPassword
(ftps) Default password to authenticate access to certificate or key indicated bykeystoreAlias- Specified by:
setKeystoreAliasPasswordin interfaceHasKeystore
-
setTruststore
(ftps) Resource url to truststore to be used for authenticating peer. If none specified, the JVMs default truststore will be used.- Specified by:
setTruststorein interfaceHasTruststore
-
setTruststoreType
(ftps) Type of truststore- Specified by:
setTruststoreTypein interfaceHasTruststore- Default value
- jks
-
setTruststoreAuthAlias
(ftps) Authentication alias used to obtain truststore password- Specified by:
setTruststoreAuthAliasin interfaceHasTruststore
-
setTruststorePassword
(ftps) Default password to access truststore- Specified by:
setTruststorePasswordin interfaceHasTruststore
-
setTrustManagerAlgorithm
(ftps) Trust manager algorithm. Can be left empty to use the servers default algorithm- Specified by:
setTrustManagerAlgorithmin interfaceHasTruststore
-
setVerifyHostname
(ftps) Iftrue, the hostname in the certificate will be checked against the actual hostname of the peer- Specified by:
setVerifyHostnamein interfaceHasTruststore
-
setAllowSelfSignedCertificates
(ftps) Iftrue, self signed certificates are accepted- Specified by:
setAllowSelfSignedCertificatesin interfaceHasTruststore- Default value
- false
-
setIgnoreCertificateExpiredException
(ftps) Iftrue, CertificateExpiredExceptions are ignored- Specified by:
setIgnoreCertificateExpiredExceptionin interfaceHasTruststore- Default value
- false
-
setProt
Sets theData Channel Protection Level.- Default value
- C
-