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 enum
static enum
static enum
static enum
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
static void
close
(org.apache.commons.net.ftp.FTPClient ftpClient) void
Configure this component.org.apache.commons.net.ftp.FTPClient
openClient
(String remoteDirectory) void
setAllowSelfSignedCertificates
(boolean b) (ftps) Iftrue
, self signed certificates are acceptedvoid
setAuthAlias
(String string) Name of the alias to obtain credentials to authenticatie on remote servervoid
setFileType
(FtpSession.FileType value) void
setFtpType
(FtpSession.FtpType value) FTP protocol to usevoid
Name or ip address of remote hostvoid
setIgnoreCertificateExpiredException
(boolean b) (ftps) Iftrue
, CertificateExpiredExceptions are ignoredvoid
setKeyManagerAlgorithm
(String keyManagerAlgorithm) (ftps) Key manager algorithm.void
setKeystore
(String string) (ftps) Resource url to keystore or certificate to be used for authentication.void
setKeystoreAlias
(String string) (ftps) Alias to obtain specific certificate or key in keystorevoid
setKeystoreAliasAuthAlias
(String string) (ftps) Authentication alias to authenticate access to certificate or key indicated bykeystoreAlias
void
setKeystoreAliasPassword
(String string) (ftps) Default password to authenticate access to certificate or key indicated bykeystoreAlias
void
setKeystoreAuthAlias
(String string) (ftps) Authentication alias used to obtain keystore passwordvoid
setKeystorePassword
(String string) (ftps) Default password to access keystorevoid
setKeystoreType
(KeystoreType value) (ftps) Type of keystorevoid
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 servervoid
setPassword
(String string) Password to authenticatie on remote servervoid
setPort
(int i) Port number of remote hostvoid
setProt
(FtpSession.Prot prot) Sets theData Channel Protection Level
.void
setProxyHost
(String string) Proxy hostnamevoid
setProxyPort
(int i) Proxy portvoid
(ftps) Transport type in case of sftpvoid
setTrustManagerAlgorithm
(String trustManagerAlgorithm) (ftps) Trust manager algorithm.void
setTruststore
(String string) (ftps) Resource url to truststore to be used for authenticating peer.void
setTruststoreAuthAlias
(String string) (ftps) Authentication alias used to obtain truststore passwordvoid
setTruststorePassword
(String string) (ftps) Default password to access truststorevoid
setTruststoreType
(KeystoreType value) (ftps) Type of truststorevoid
setUsername
(String string) Name of the user to authenticatie on remote servervoid
setVerifyHostname
(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, wait
Methods inherited from interface org.frankframework.core.HasApplicationContext
getApplicationContext, getConfigurationClassLoader
Methods inherited from interface org.frankframework.encryption.HasKeystore
getKeyManagerAlgorithm, getKeystore, getKeystoreAlias, getKeystoreAliasAuthAlias, getKeystoreAliasPassword, getKeystoreAuthAlias, getKeystorePassword, getKeystoreType
Methods 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:IConfigurable
Configure 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:
configure
in 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
public 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:
setKeystore
in interfaceHasKeystore
-
setKeystoreType
(ftps) Type of keystore- Specified by:
setKeystoreType
in interfaceHasKeystore
- Default value
- pkcs12
-
setKeystoreAuthAlias
(ftps) Authentication alias used to obtain keystore password- Specified by:
setKeystoreAuthAlias
in interfaceHasKeystore
-
setKeystorePassword
(ftps) Default password to access keystore- Specified by:
setKeystorePassword
in interfaceHasKeystore
-
setKeyManagerAlgorithm
(ftps) Key manager algorithm. Can be left empty to use the servers default algorithm- Specified by:
setKeyManagerAlgorithm
in interfaceHasKeystore
-
setKeystoreAlias
(ftps) Alias to obtain specific certificate or key in keystore- Specified by:
setKeystoreAlias
in interfaceHasKeystore
-
setKeystoreAliasAuthAlias
(ftps) Authentication alias to authenticate access to certificate or key indicated bykeystoreAlias
- Specified by:
setKeystoreAliasAuthAlias
in interfaceHasKeystore
-
setKeystoreAliasPassword
(ftps) Default password to authenticate access to certificate or key indicated bykeystoreAlias
- Specified by:
setKeystoreAliasPassword
in 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:
setTruststore
in interfaceHasTruststore
-
setTruststoreType
(ftps) Type of truststore- Specified by:
setTruststoreType
in interfaceHasTruststore
- Default value
- jks
-
setTruststoreAuthAlias
(ftps) Authentication alias used to obtain truststore password- Specified by:
setTruststoreAuthAlias
in interfaceHasTruststore
-
setTruststorePassword
(ftps) Default password to access truststore- Specified by:
setTruststorePassword
in interfaceHasTruststore
-
setTrustManagerAlgorithm
(ftps) Trust manager algorithm. Can be left empty to use the servers default algorithm- Specified by:
setTrustManagerAlgorithm
in interfaceHasTruststore
-
setVerifyHostname
(ftps) Iftrue
, the hostname in the certificate will be checked against the actual hostname of the peer- Specified by:
setVerifyHostname
in interfaceHasTruststore
-
setAllowSelfSignedCertificates
(ftps) Iftrue
, self signed certificates are accepted- Specified by:
setAllowSelfSignedCertificates
in interfaceHasTruststore
- Default value
- false
-
setIgnoreCertificateExpiredException
(ftps) Iftrue
, CertificateExpiredExceptions are ignored- Specified by:
setIgnoreCertificateExpiredException
in interfaceHasTruststore
- Default value
- false
-
setProt
Sets theData Channel Protection Level
.- Default value
- C
-