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 BwithAsyncRequests(int outstandingRequest) The number of SFTP messages to send asynchronously before checking for server responses.final BwithBlocksize(int blocksize) The SFTP block size to use in SFTP operations.final BwithBufferSize(int buffersize) The size of the buffer used to pre-read the file during upload.final BwithChunkProgress(Function<LOCALFILE, FileTransferProgress> chunkProgress) final BwithChunks(int chunks) Set how many chunks to split any paths into for transfer.final BwithDigest(RemoteHash digest) The message digest algorithm to use for integrity checks (seewithVerifyIntegrity()).final BOnly warn about integrity checks, do not fail entirely.final BwithIgnoreIntegrity(boolean ignoreIntegrity) Only warn about integrity checks, do not fail entirely.final BwithIntegrityVerification(boolean verifyIntegrity) Set whether to verify the integrity of any paths transferred using the configured digest (seewithDigest(RemoteHash).final BwithPrimarySftpClient(SftpClient primarySftpClient) Set anSftpClientto use instead of creating a new one.final BwithProgressMessages(AbstractOptimisedTask.ProgressMessages progressMessages) Set theAbstractOptimisedTask.ProgressMessagescallback to receive various progress message, it does not receive the actual amount of progress.final BOutput verbose information about the operation.final BwithVerboseOutput(boolean verboseOutput) Output verbose information about the operation.final BThe 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, withProgressMethods inherited from class com.sshtools.client.tasks.AbstractConnectionTask.AbstractConnectionTaskBuilder
withClient, withClients, withConnection
-
Constructor Details
-
AbstractOptimisedTaskBuilder
protected AbstractOptimisedTaskBuilder()
-
-
Method Details
-
withProgressMessages
Set theAbstractOptimisedTask.ProgressMessagescallback 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 aFunctionthat can createFileTransferProgressinstances given aAbstractFile. EachFileTransferProgressmonitors 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 anSftpClientto 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
-