Package org.citrusframework.ftp.client
Class SftpClient
java.lang.Object
org.citrusframework.endpoint.AbstractEndpoint
org.citrusframework.ftp.client.FtpClient
org.citrusframework.ftp.client.SftpClient
- All Implemented Interfaces:
InitializingPhase,Named,ShutdownPhase,Endpoint,org.citrusframework.messaging.Consumer,org.citrusframework.messaging.Producer,org.citrusframework.messaging.ReplyConsumer,org.citrusframework.messaging.SelectiveConsumer
- Direct Known Subclasses:
ScpClient
- Since:
- 2.7.5
- Author:
- Christoph Deppisch
-
Constructor Summary
ConstructorsModifierConstructorDescriptionDefault constructor initializing endpoint configuration.protectedSftpClient(SftpEndpointConfiguration endpointConfiguration) Default constructor using endpoint configuration. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidOpens a new connection and performs login with user name and password if set.protected FtpMessagecreateDir(CommandType ftpCommand) Execute mkDir command and create new directory.protected FtpMessagedeleteFile(DeleteCommand delete, TestContext context) Performs delete file operation.voiddestroy()protected FtpMessageexecuteCommand(CommandType ftpCommand, TestContext context) protected Stringcom.jcraft.jsch.JSchgetSsh()Gets the ssh.voidprotected booleanisDirectory(String remoteFilePath) Check file path type directory or file.protected FtpMessagelistFiles(ListCommand list, TestContext context) Perform list files operation and provide file information as response.protected FtpMessageretrieveFile(GetCommand command, TestContext context) Performs retrieve file operation.voidsetSsh(com.jcraft.jsch.JSch ssh) Sets the ssh.protected FtpMessagestoreFile(PutCommand command, TestContext context) Performs store file operation.Methods inherited from class org.citrusframework.ftp.client.FtpClient
addFileNameToTargetPath, createConsumer, createProducer, getFtpClient, getLocalFileInputStream, receive, receive, receive, receive, send, setCorrelationManager, setFtpClientMethods inherited from class org.citrusframework.endpoint.AbstractEndpoint
getActor, getConsumerName, getName, getProducerName, setActor, setNameMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.citrusframework.messaging.Consumer
getNameMethods inherited from interface org.citrusframework.messaging.Producer
getName
-
Constructor Details
-
SftpClient
public SftpClient()Default constructor initializing endpoint configuration. -
SftpClient
Default constructor using endpoint configuration.- Parameters:
endpointConfiguration-
-
-
Method Details
-
getEndpointConfiguration
- Specified by:
getEndpointConfigurationin interfaceEndpoint- Overrides:
getEndpointConfigurationin classFtpClient
-
executeCommand
- Overrides:
executeCommandin classFtpClient
-
createDir
Execute mkDir command and create new directory.- Parameters:
ftpCommand-- Returns:
-
listFiles
Description copied from class:FtpClientPerform list files operation and provide file information as response. -
deleteFile
Description copied from class:FtpClientPerforms delete file operation.- Overrides:
deleteFilein classFtpClient
-
isDirectory
Description copied from class:FtpClientCheck file path type directory or file.- Overrides:
isDirectoryin classFtpClient- Returns:
-
storeFile
Description copied from class:FtpClientPerforms store file operation. -
retrieveFile
Description copied from class:FtpClientPerforms retrieve file operation.- Overrides:
retrieveFilein classFtpClient
-
connectAndLogin
protected void connectAndLogin()Description copied from class:FtpClientOpens a new connection and performs login with user name and password if set.- Overrides:
connectAndLoginin classFtpClient
-
getPrivateKeyPath
- Throws:
IOException
-
initialize
public void initialize()- Specified by:
initializein interfaceInitializingPhase- Overrides:
initializein classFtpClient
-
destroy
public void destroy()- Specified by:
destroyin interfaceShutdownPhase- Overrides:
destroyin classFtpClient
-
getSsh
public com.jcraft.jsch.JSch getSsh()Gets the ssh.- Returns:
-
setSsh
public void setSsh(com.jcraft.jsch.JSch ssh) Sets the ssh.- Parameters:
ssh-
-