Package com.sshtools.client.tasks
Class UploadInputStreamTask.UploadInputStreamTaskBuilder
java.lang.Object
com.sshtools.client.tasks.AbstractConnectionTask.AbstractConnectionTaskBuilder<B,T>
com.sshtools.client.tasks.AbstractFileTask.AbstractFileTaskBuilder<UploadInputStreamTask.UploadInputStreamTaskBuilder,UploadInputStreamTask>
com.sshtools.client.tasks.UploadInputStreamTask.UploadInputStreamTaskBuilder
- Enclosing class:
- UploadInputStreamTask
public static final class UploadInputStreamTask.UploadInputStreamTaskBuilder
extends AbstractFileTask.AbstractFileTaskBuilder<UploadInputStreamTask.UploadInputStreamTaskBuilder,UploadInputStreamTask>
Builder for
UploadInputStreamTask
.-
Field Summary
Fields inherited from class com.sshtools.client.tasks.AbstractConnectionTask.AbstractConnectionTaskBuilder
clientSupplier, connection
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
create()
Create a newUploadInputStreamTask.UploadInputStreamTaskBuilder
withInputStream
(InputStream input) Set theInputStream
to upload.withLength
(long length) Set the length of content that will be uploaded (if known).withRemote
(Path remote) Set the remote path to upload the file to.withRemote
(Optional<Path> remote) Set the remote path to upload the file to.withRemotePath
(String remote) Set the remote path to upload the file to.withRemotePath
(Optional<String> remote) Set the remote path to upload the file to.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 newUploadInputStreamTask.UploadInputStreamTaskBuilder
- Returns:
- builder
-
withRemotePath
Set the remote path to upload the file to. If empty, will be uploaded the current remote working directory- Parameters:
remote
- remote path- Returns:
- builder for chaining
-
withRemote
Set the remote path to upload the file to. If empty, will be uploaded the current remote working directory- Parameters:
remote
- remote path- Returns:
- builder for chaining
-
withRemote
Set the remote path to upload the file to. If empty, will be uploaded the current remote working directory- Parameters:
remote
- remote path- Returns:
- builder for chaining
-
withRemotePath
Set the remote path to upload the file to. If empty, will be uploaded the current remote working directory- Parameters:
remote
- remote path- Returns:
- builder for chaining
-
withInputStream
Set theInputStream
to upload. This is required. If possible, you should also usewithLength(long)
to set the content length.- Parameters:
input
- input stream- Returns:
- builder for chaining
-
withLength
Set the length of content that will be uploaded (if known). This is only used by client code for progress calculation. It will be passed toFileTransferProgress.started(long, String)
. If not set,-1
will be passed instead (meaning "indeterminate").- Parameters:
length
- length- Returns:
- builder for chaining
-
build
-