Package com.sshtools.client.tasks
Class PushTask.PushTaskBuilder
java.lang.Object
com.sshtools.client.tasks.AbstractConnectionTask.AbstractConnectionTaskBuilder<B,T>
com.sshtools.client.tasks.AbstractFileTask.AbstractFileTaskBuilder<B,T>
com.sshtools.client.tasks.AbstractOptimisedTask.AbstractOptimisedTaskBuilder<PushTask.PushTaskBuilder,PushTask,com.sshtools.common.files.AbstractFile>
com.sshtools.client.tasks.PushTask.PushTaskBuilder
- Enclosing class:
- PushTask
public static class PushTask.PushTaskBuilder
extends AbstractOptimisedTask.AbstractOptimisedTaskBuilder<PushTask.PushTaskBuilder,PushTask,com.sshtools.common.files.AbstractFile>
Builder for
PushTask
.-
Field Summary
Fields inherited from class com.sshtools.client.tasks.AbstractConnectionTask.AbstractConnectionTaskBuilder
clientSupplier, connection
-
Method Summary
Modifier and TypeMethodDescriptionaddFilePaths
(Collection<String> filePaths) Add a collection of paths to transfer.addFiles
(Collection<File> files) Add a collection of files to transfer.addPaths
(Collection<Path> paths) Add a collection of paths to transfer.build()
Build a newPushTask
that may be scheduled for execution (e.g.static PushTask.PushTaskBuilder
create()
Create a newPushTask.PushTaskBuilder
withFilePaths
(Collection<String> files) Set a collection of file paths to transfer.Set an array of files to transfer.withFilesPaths
(String... filePaths) Set an array of files to transfer.Set an array of files to transfer.withPaths
(Collection<Path> paths) Set a collection of file paths to transfer.withRemoteFolder
(String remoteFolder) Set the remote folder where any transferred paths will be placed.withRemoteFolder
(Path remoteFolder) Set the remote folder where any transferred paths will be placed.withRemoteFolder
(Optional<Path> remoteFolder) Set the remote folder where any transferred paths will be placed.Methods inherited from class com.sshtools.client.tasks.AbstractOptimisedTask.AbstractOptimisedTaskBuilder
withAsyncRequests, withBlocksize, withBufferSize, withChunkProgress, withChunks, withDigest, withIgnoreIntegrity, withIgnoreIntegrity, withIntegrityVerification, withPrimarySftpClient, withProgressMessages, withVerboseOutput, withVerboseOutput, withVerifyIntegrity
Methods inherited from class com.sshtools.client.tasks.AbstractFileTask.AbstractFileTaskBuilder
withProgress, withProgress
Methods inherited from class com.sshtools.client.tasks.AbstractConnectionTask.AbstractConnectionTaskBuilder
withClient, withClients, withConnection
-
Method Details
-
create
Create a newPushTask.PushTaskBuilder
- Returns:
- builder
-
addFilePaths
Add a collection of paths to transfer. Each should be the path of theLocal
file, and will be resolved against the current virtual file system configured on theSftpClient
.- Parameters:
filePaths
- file paths to add.- Returns:
- builder for chaining
-
addPaths
Add a collection of paths to transfer. Each should be the path of theLocal
file, and will be resolved against the current virtual file system configured on theSftpClient
.- Parameters:
paths
- file paths to add.- Returns:
- builder for chaining
-
addFiles
Add a collection of files to transfer. Each should be the path of theLocal
file, and will be resolved against the current virtual file system configured on theSftpClient
.- Parameters:
files
- file paths to add.- Returns:
- builder for chaining
-
withFilePaths
Set a collection of file paths to transfer. Any paths already added to this builder will be replaced. Each should be the path of theLocal
file, and will be resolved against the current virtual file system configured on theSftpClient
.- Parameters:
paths
- all file paths to transfer.- Returns:
- builder for chaining
-
withPaths
Set a collection of file paths to transfer. Any paths already added to this builder will be replaced. Each should be the path of theLocal
file, and will be resolved against the current virtual file system configured on theSftpClient
.- Parameters:
paths
- all file paths to transfer.- Returns:
- builder for chaining
-
withFiles
Set an array of files to transfer. Any paths already added to this builder will be replaced. Each should be the path of theLocal
file, and will be resolved against the current virtual file system configured on theSftpClient
.- Parameters:
files
- all file paths to transfer.- Returns:
- builder for chaining
-
withPaths
Set an array of files to transfer. Any paths already added to this builder will be replaced. Each should be the path of theLocal
file, and will be resolved against the current virtual file system configured on theSftpClient
.- Parameters:
paths
- all file paths to transfer.- Returns:
- builder for chaining
-
withFilesPaths
Set an array of files to transfer. Any paths already added to this builder will be replaced. Each should be the path of theLocal
file, and will be resolved against the current virtual file system configured on theSftpClient
.- Parameters:
filePaths
- all file paths to transfer.- Returns:
- builder for chaining
-
withRemoteFolder
Set the remote folder where any transferred paths will be placed.- Parameters:
remoteFolder
- remote folder- Returns:
- builder for chaining
-
withRemoteFolder
Set the remote folder where any transferred paths will be placed.- Parameters:
remoteFolder
- remote folder- Returns:
- builder for chaining
-
withRemoteFolder
Set the remote folder where any transferred paths will be placed. If this evaluates toOptional.empty()
, then the default remote folder will be used (e.g. the users home directory).- Parameters:
remoteFolder
- remote folder- Returns:
- builder for chaining
-
build
Build a newPushTask
that may be scheduled for execution (e.g.SshClient.addTask(Task)
). The created task takes a copy of the configuration in this builder for the immutable task, so if the builder is changed after building the task instance, it will not be affected.- Specified by:
build
in classAbstractFileTask.AbstractFileTaskBuilder<PushTask.PushTaskBuilder,
PushTask> - Returns:
- task
-