Package com.sshtools.client.tasks
Class AbstractOptimisedTask.AbstractOptimisedTaskBuilder<B extends AbstractOptimisedTask.AbstractOptimisedTaskBuilder<B,T,LOCALFILE>,T extends AbstractOptimisedTask<?,?>,LOCALFILE>
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<B,T,LOCALFILE>
- Direct Known Subclasses:
PullTask.PullTaskBuilder
,PushTask.PushTaskBuilder
- Enclosing class:
- AbstractOptimisedTask<TARGET,
LOCALFILE>
public abstract static class AbstractOptimisedTask.AbstractOptimisedTaskBuilder<B extends AbstractOptimisedTask.AbstractOptimisedTaskBuilder<B,T,LOCALFILE>,T extends AbstractOptimisedTask<?,?>,LOCALFILE>
extends AbstractFileTask.AbstractFileTaskBuilder<B,T>
-
Field Summary
Fields inherited from class com.sshtools.client.tasks.AbstractConnectionTask.AbstractConnectionTaskBuilder
clientSupplier, connection
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal B
withAsyncRequests
(int outstandingRequest) The number of SFTP messages to send asynchronously before checking for server responses.final B
withBlocksize
(int blocksize) The SFTP block size to use in SFTP operations.final B
withBufferSize
(int buffersize) The size of the buffer used to pre-read the file during upload.final B
withChunkProgress
(Function<LOCALFILE, FileTransferProgress> chunkProgress) final B
withChunks
(int chunks) Set how many chunks to split any paths into for transfer.final B
withDigest
(RemoteHash digest) The message digest algorithm to use for integrity checks (seewithVerifyIntegrity()
).final B
Only warn about integrity checks, do not fail entirely.final B
withIgnoreIntegrity
(boolean ignoreIntegrity) Only warn about integrity checks, do not fail entirely.final B
withIntegrityVerification
(boolean verifyIntegrity) Set whether to verify the integrity of any paths transferred using the configured digest (seewithDigest(RemoteHash)
.final B
withPrimarySftpClient
(SftpClient primarySftpClient) Set anSftpClient
to use instead of creating a new one.final B
withProgressMessages
(AbstractOptimisedTask.ProgressMessages progressMessages) Set theAbstractOptimisedTask.ProgressMessages
callback to receive various progress message, it does not receive the actual amount of progress.final B
Output verbose information about the operation.final B
withVerboseOutput
(boolean verboseOutput) Output verbose information about the operation.final B
The integrity of any paths transferred will be verified using the configured digest (seewithDigest(RemoteHash)
.Methods inherited from class com.sshtools.client.tasks.AbstractFileTask.AbstractFileTaskBuilder
build, withProgress, withProgress
Methods inherited from class com.sshtools.client.tasks.AbstractConnectionTask.AbstractConnectionTaskBuilder
withClient, withClients, withConnection
-
Constructor Details
-
AbstractOptimisedTaskBuilder
protected AbstractOptimisedTaskBuilder()
-
-
Method Details
-
withProgressMessages
Set theAbstractOptimisedTask.ProgressMessages
callback to receive various progress message, it does not receive the actual amount of progress. See {@link- Parameters:
progressMessages
- progressMessages- Returns:
- builder for chaining
-
withChunkProgress
Set aFunction
that can createFileTransferProgress
instances given aAbstractFile
. EachFileTransferProgress
monitors a Chunk, which will either be a complete file, or a portion of it. So if the function is called multiple times with the sameAbstractFile
, each call should create a new instance per chunk. Once created,FileTransferProgress.started(long, String)
may be called multiple times if multiple paths are being transferred.- Parameters:
chunkProgress
- chunk transfer progress monitor- Returns:
- builder for chaining
-
withPrimarySftpClient
Set anSftpClient
to use instead of creating a new one. Note, this is only used for the primary SFTP connection, others will always be created internally for chunked transfers.- Parameters:
primarySftpClient
- SFTP client- Returns:
- builder for chaining
-
withChunks
Set how many chunks to split any paths into for transfer.- Parameters:
chunks
-- Returns:
- builder for chaining
-
withBufferSize
The size of the buffer used to pre-read the file during upload. Defaults to 1MB.- Parameters:
buffersize
-- Returns:
-
withVerifyIntegrity
The integrity of any paths transferred will be verified using the configured digest (seewithDigest(RemoteHash)
. If verification fails, an exception will be thrown during transfer.- Returns:
- builder for chaining
-
withIntegrityVerification
Set whether to verify the integrity of any paths transferred using the configured digest (seewithDigest(RemoteHash)
. If verification fails, an exception will be thrown during transfer.- Parameters:
verifyIntegrity
- integrity verification- Returns:
- builder for chaining
-
withIgnoreIntegrity
Only warn about integrity checks, do not fail entirely.- Returns:
- builder for chaining
-
withIgnoreIntegrity
Only warn about integrity checks, do not fail entirely.- Parameters:
ignoreIntegrity
- ignore integrity- Returns:
- builder for chaining
-
withDigest
The message digest algorithm to use for integrity checks (seewithVerifyIntegrity()
).- Parameters:
digest
- digest- Returns:
- builder for chaining
-
withBlocksize
The SFTP block size to use in SFTP operations. The default is 32k which is generally the optimal amount but can be changed for experimentation. The API will also optimise the block size and change your value at runtime if it detects it would cause SFTP packages to be fragmented across multiple data packets causing performance issues. The minimum block size supported is 4096 bytes and the maximum size supported is 65535 bytes.- Parameters:
blocksize
-- Returns:
- builder for chaining
-
withAsyncRequests
The number of SFTP messages to send asynchronously before checking for server responses. Sending messages asynchronously increases performance and the API will generally configure this to it's own optimal setting based on remote window space and block size. Use this to experiment with various settings on your own network.- Parameters:
outstandingRequest
-- Returns:
- builder for chaining
-
withVerboseOutput
Output verbose information about the operation.- Returns:
- builder for chaining
-
withVerboseOutput
Output verbose information about the operation.- Returns:
- builder for chaining
-