public class FtpSession extends Object implements IConfigurable, HasKeystore, HasTruststore
Modifier and Type | Class and Description |
---|---|
static class |
FtpSession.FileType |
static class |
FtpSession.FtpType |
static class |
FtpSession.Prot |
Modifier and Type | Field and Description |
---|---|
org.apache.commons.net.ftp.FTPClient |
ftpClient |
protected org.apache.logging.log4j.Logger |
log |
Constructor and Description |
---|
FtpSession() |
Modifier and Type | Method and Description |
---|---|
protected void |
checkReply(String cmd) |
void |
closeClient() |
void |
configure() |
void |
deleteRemote(String remoteDirectory,
String filename,
boolean closeAfterDelete) |
String |
get(ParameterList params,
PipeLineSession session,
String localDirectory,
String remoteDirectory,
String filenames,
String localFilenamePattern,
boolean closeAfterGet) |
boolean |
isConsoleKnownHostsVerifier() |
List<String> |
ls(String remoteDirectory,
boolean filesOnly,
boolean closeAfterSend) |
String |
lsAsString(String remoteDirectory,
boolean filesOnly,
boolean closeAfterSend) |
void |
openClient(String remoteDirectory) |
String |
put(ParameterList params,
PipeLineSession session,
String message,
String remoteDirectory,
String remoteFilenamePattern,
boolean closeAfterSend) |
void |
setAllowSelfSignedCertificates(boolean b)
(ftps) If
true , self signed certificates are accepted |
void |
setAuthAlias(String string)
Name of the alias to obtain credentials to authenticatie on remote server
|
void |
setCertificate(String string)
Deprecated.
|
void |
setCertificateAuthAlias(String string)
Deprecated.
|
void |
setCertificatePassword(String string)
Deprecated.
|
void |
setCertificateType(KeystoreType value)
Deprecated.
|
void |
setConsoleKnownHostsVerifier(boolean b)
(sftp)
|
void |
setFileType(FtpSession.FileType value) |
void |
setFtpType(FtpSession.FtpType value)
FTP protocol to use
|
void |
setFtpTypeDescription(FtpSession.FtpType value)
Deprecated.
|
void |
setHost(String string)
Name or ip address of remote host
|
void |
setIgnoreCertificateExpiredException(boolean b)
(ftps) If
true , CertificateExpiredExceptions are ignored |
void |
setKeyboardInteractive(boolean keyboardInteractive)
When
true , keyboardinteractive is used to login |
void |
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 keystore
|
void |
setKeystoreAliasAuthAlias(String string)
(ftps) Authentication alias to authenticate access to certificate or key indicated by
keystoreAlias |
void |
setKeystoreAliasPassword(String string)
(ftps) Default password to authenticate access to certificate or key indicated by
keystoreAlias |
void |
setKeystoreAuthAlias(String string)
(ftps) Authentication alias used to obtain keystore password
|
void |
setKeystorePassword(String string)
(ftps) Default password to access keystore
|
void |
setKeystoreType(KeystoreType value)
(ftps) Type of keystore
|
void |
setKnownHostsPath(String string)
(sftp) Path to file with knownhosts
|
void |
setMessageIsContent(boolean b)
If
true , the contents of the message is send, otherwise it message contains the local filenames of the files to be send |
void |
setName(String name)
The functional name of the object.
|
void |
setPassive(boolean b)
If
true , passive ftp is used: before data is sent, a pasv command is issued, and the connection is set up by the server |
void |
setPassword(String string)
Password to authenticatie on remote server
|
void |
setPort(int i)
Port number of remote host
|
void |
setPrefCSEncryption(String string)
(sftp) Optional preferred encryption from client to server for sftp protocol
|
void |
setPrefSCEncryption(String string)
(sftp) Optional preferred encryption from server to client for sftp protocol
|
void |
setPrivateKeyAuthAlias(String string)
(sftp) Name of the alias to obtain credentials for passphrase of private key file
|
void |
setPrivateKeyFilePath(String string)
(sftp) Path to private key file for sftp authentication
|
void |
setPrivateKeyPassword(String password)
(sftp) Passphrase of private key file
|
void |
setProt(FtpSession.Prot prot)
Sets the
Data Channel Protection Level . |
void |
setProtP(boolean b)
Deprecated.
|
void |
setProxyAuthAlias(String string)
alias to obtain credentials to authenticate on proxy
|
void |
setProxyHost(String string)
Proxy hostname
|
void |
setProxyPassword(String string)
Default password in case proxy requires authentication
|
void |
setProxyPort(int i)
Proxy port
|
void |
setProxyTransportType(int i)
(sftp) Transport type in case of sftp (1=standard, 2=http, 3=socks4, 4=socks5)
|
void |
setProxyUsername(String string)
Default user name in case proxy requires authentication
|
void |
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 password
|
void |
setTruststorePassword(String string)
(ftps) Default password to access truststore
|
void |
setTruststoreType(KeystoreType value)
(ftps) Type of truststore
|
void |
setUsername(String string)
Name of the user to authenticatie on remote server
|
void |
setVerifyHostname(boolean b)
(ftps) If
true , the hostname in the certificate will be checked against the actual hostname of the peer |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getName
getKeyManagerAlgorithm, getKeystore, getKeystoreAlias, getKeystoreAliasAuthAlias, getKeystoreAliasPassword, getKeystoreAuthAlias, getKeystorePassword, getKeystoreType
getApplicationContext, getName
getConfigurationClassLoader
setApplicationContext
getTrustManagerAlgorithm, getTruststore, getTruststoreAuthAlias, getTruststorePassword, getTruststoreType, isAllowSelfSignedCertificates, isIgnoreCertificateExpiredException, isVerifyHostname
protected org.apache.logging.log4j.Logger log
public org.apache.commons.net.ftp.FTPClient ftpClient
public void configure() throws ConfigurationException
configure
in interface IConfigurable
ConfigurationException
public void openClient(String remoteDirectory) throws FtpConnectException
FtpConnectException
protected void checkReply(String cmd) throws IOException
IOException
public void closeClient()
public String put(ParameterList params, PipeLineSession session, String message, String remoteDirectory, String remoteFilenamePattern, boolean closeAfterSend) throws Exception
Exception
public List<String> ls(String remoteDirectory, boolean filesOnly, boolean closeAfterSend) throws Exception
Exception
public String lsAsString(String remoteDirectory, boolean filesOnly, boolean closeAfterSend) throws Exception
Exception
public String get(ParameterList params, PipeLineSession session, String localDirectory, String remoteDirectory, String filenames, String localFilenamePattern, boolean closeAfterGet) throws Exception
Exception
public void deleteRemote(String remoteDirectory, String filename, boolean closeAfterDelete) throws Exception
Exception
public void setHost(String string)
public void setPort(int i)
public void setAuthAlias(String string)
public void setUsername(String string)
public void setPassword(String string)
public void setProxyHost(String string)
public void setProxyPort(int i)
public void setProxyAuthAlias(String string)
public void setProxyUsername(String string)
public void setProxyPassword(String string)
@Deprecated @ConfigurationWarning(value="use attribute ftpType instead") public void setFtpTypeDescription(FtpSession.FtpType value)
public void setFtpType(FtpSession.FtpType value)
public void setFileType(FtpSession.FileType value)
public void setMessageIsContent(boolean b)
true
, the contents of the message is send, otherwise it message contains the local filenames of the files to be sendpublic void setPassive(boolean b)
true
, passive ftp is used: before data is sent, a pasv command is issued, and the connection is set up by the serverpublic void setProxyTransportType(int i)
public void setPrefCSEncryption(String string)
public void setPrefSCEncryption(String string)
public void setPrivateKeyFilePath(String string)
public void setPrivateKeyAuthAlias(String string)
public void setPrivateKeyPassword(String password)
public void setKnownHostsPath(String string)
public void setConsoleKnownHostsVerifier(boolean b)
public boolean isConsoleKnownHostsVerifier()
@Deprecated @ConfigurationWarning(value="Please use attribute keystore instead") public void setCertificate(String string)
@Deprecated @ConfigurationWarning(value="has been replaced with keystoreType") public void setCertificateType(KeystoreType value)
@Deprecated @ConfigurationWarning(value="Please use attribute keystoreAuthAlias instead") public void setCertificateAuthAlias(String string)
@Deprecated @ConfigurationWarning(value="Please use attribute keystorePassword instead") public void setCertificatePassword(String string)
public void setKeystore(String string)
setKeystore
in interface HasKeystore
public void setKeystoreType(KeystoreType value)
setKeystoreType
in interface HasKeystore
public void setKeystoreAuthAlias(String string)
setKeystoreAuthAlias
in interface HasKeystore
public void setKeystorePassword(String string)
setKeystorePassword
in interface HasKeystore
public void setKeyManagerAlgorithm(String keyManagerAlgorithm)
setKeyManagerAlgorithm
in interface HasKeystore
public void setKeystoreAlias(String string)
setKeystoreAlias
in interface HasKeystore
public void setKeystoreAliasAuthAlias(String string)
keystoreAlias
setKeystoreAliasAuthAlias
in interface HasKeystore
public void setKeystoreAliasPassword(String string)
keystoreAlias
setKeystoreAliasPassword
in interface HasKeystore
public void setTruststore(String string)
setTruststore
in interface HasTruststore
public void setTruststoreType(KeystoreType value)
setTruststoreType
in interface HasTruststore
public void setTruststoreAuthAlias(String string)
setTruststoreAuthAlias
in interface HasTruststore
public void setTruststorePassword(String string)
setTruststorePassword
in interface HasTruststore
public void setTrustManagerAlgorithm(String trustManagerAlgorithm)
setTrustManagerAlgorithm
in interface HasTruststore
public void setVerifyHostname(boolean b)
true
, the hostname in the certificate will be checked against the actual hostname of the peersetVerifyHostname
in interface HasTruststore
public void setAllowSelfSignedCertificates(boolean b)
true
, self signed certificates are acceptedsetAllowSelfSignedCertificates
in interface HasTruststore
public void setIgnoreCertificateExpiredException(boolean b)
true
, CertificateExpiredExceptions are ignoredsetIgnoreCertificateExpiredException
in interface HasTruststore
@Deprecated @ConfigurationWarning(value="use attribute prot=\"P\" instead") public void setProtP(boolean b)
public void setProt(FtpSession.Prot prot)
Data Channel Protection Level
.public void setKeyboardInteractive(boolean keyboardInteractive)
true
, keyboardinteractive is used to loginpublic void setName(String name)
INamedObject
setName
in interface INamedObject
Copyright © 2023 Frank!Framework. All rights reserved.