Class SftpSession
java.lang.Object
org.frankframework.filesystem.sftp.SftpSession
- All Implemented Interfaces:
IConfigurable
- Direct Known Subclasses:
SftpFileSystem
Helper class for sftp.
Use
getClient() to retrieve the SFTP Client.
Don't forget to call close() to close the Client!- Author:
- Niels Meijer
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidclose()Closes the client and correlating SFTP session.voidConfigure this component.protected com.jcraft.jsch.ChannelSftpGet the client to execute SFTP commands on.protected booleanvoidopen()voidsetAuthAlias(String string) Name of the alias to obtain credentials to authenticatie on remote servervoidName or ip address of remote hostvoidsetKnownHostsPath(String string) Path to file with knownhostsvoidsetPassword(String string) Password to authenticatie on remote servervoidsetPort(int i) Port number of remote hostvoidsetPrefCSEncryption(String string) Optional preferred encryption from client to server for sftp protocolvoidsetPrefSCEncryption(String string) Optional preferred encryption from server to client for sftp protocolvoidsetPrivateKeyAuthAlias(String string) Name of the alias to obtain credentials for passphrase of private key filevoidsetPrivateKeyFilePath(String string) Path to private key file for sftp authenticationvoidsetPrivateKeyPassword(String password) Passphrase of private key filevoidsetProxyAuthAlias(String string) alias to obtain credentials to authenticate on proxyvoidsetProxyHost(String string) Proxy hostnamevoidsetProxyPassword(String string) Default password in case proxy requires authenticationvoidsetProxyPort(int i) Proxy portvoidTransport type in case of sftpvoidsetProxyUsername(String string) Default user name in case proxy requires authenticationvoidsetStrictHostKeyChecking(boolean b) Verify the hosts againt the knownhosts file.voidsetUsername(String string) Name of the user to authenticatie on remote server
-
Constructor Details
-
SftpSession
public SftpSession()
-
-
Method Details
-
open
- Throws:
FileSystemException
-
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.
-
getClient
protected com.jcraft.jsch.ChannelSftp getClient()Get the client to execute SFTP commands on. -
close
protected void close()Closes the client and correlating SFTP session. -
isSessionStillWorking
protected boolean isSessionStillWorking() -
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
-
setProxyAuthAlias
alias to obtain credentials to authenticate on proxy -
setProxyUsername
Default user name in case proxy requires authentication -
setProxyPassword
Default password in case proxy requires authentication -
setProxyTransportType
Transport type in case of sftp- Default value
- SOCKS5
-
setPrefCSEncryption
Optional preferred encryption from client to server for sftp protocol -
setPrefSCEncryption
Optional preferred encryption from server to client for sftp protocol -
setPrivateKeyFilePath
Path to private key file for sftp authentication -
setPrivateKeyAuthAlias
Name of the alias to obtain credentials for passphrase of private key file -
setPrivateKeyPassword
Passphrase of private key file -
setKnownHostsPath
Path to file with knownhosts -
setStrictHostKeyChecking
public void setStrictHostKeyChecking(boolean b) Verify the hosts againt the knownhosts file.- Default value
- true
-