Package com.sshtools.client.tasks
Class PullTask.PullTaskBuilder
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<PullTask.PullTaskBuilder,PullTask,String>
com.sshtools.client.tasks.PullTask.PullTaskBuilder
- Enclosing class:
- PullTask
public static class PullTask.PullTaskBuilder
extends AbstractOptimisedTask.AbstractOptimisedTaskBuilder<PullTask.PullTaskBuilder,PullTask,String>
Builder for
PullTask
.-
Field Summary
Fields inherited from class com.sshtools.client.tasks.AbstractConnectionTask.AbstractConnectionTaskBuilder
clientSupplier, connection
-
Method Summary
Modifier and TypeMethodDescriptionAdd a collection of paths to transfer.addPaths
(Collection<String> filePaths) Add a collection of paths to transfer.build()
Build a newPullTask
that may be scheduled for execution (e.g.static PullTask.PullTaskBuilder
create()
Create a newPullTask.PullTaskBuilder
withLocalFolder
(String localFolder) Set the local folder where any transferred paths will be placed.withLocalFolder
(Path localFolder) Set the remote folder where any transferred paths will be placed.withLocalFolder
(Optional<Path> localFolder) Set the remote folder where any transferred paths will be placed.Set an array of files to transfer.withPaths
(Collection<String> filePaths) Set an array of files to transfer.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 newPullTask.PullTaskBuilder
- Returns:
- builder
-
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:
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
-
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
-
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:
filePaths
- all file paths to transfer.- Returns:
- builder for chaining
-
withLocalFolder
Set the local folder where any transferred paths will be placed.- Parameters:
localFolder
- remote folder- Returns:
- builder for chaining
-
withLocalFolder
Set the remote folder where any transferred paths will be placed.- Parameters:
localFolder
- remote folder- Returns:
- builder for chaining
-
withLocalFolder
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:
localFolder
- local folder- Returns:
- builder for chaining
-
build
Build a newPullTask
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<PullTask.PullTaskBuilder,
PullTask> - Returns:
- task
-