Package com.sshtools.client.tasks
Class UploadFileContentTask
java.lang.Object
com.sshtools.common.ssh.AbstractRequestFuture
com.sshtools.common.ssh.ConnectionAwareTask
com.sshtools.client.tasks.Task
com.sshtools.client.tasks.AbstractConnectionTask
com.sshtools.client.tasks.AbstractFileTask
com.sshtools.client.tasks.UploadFileContentTask
- All Implemented Interfaces:
com.sshtools.common.ssh.RequestFuture
,Runnable
An SFTP
Task
that uploads string content to a remote file.
You cannot directly create a UploadFileContentTask
, instead use UploadInputStreamTask.UploadInputStreamTaskBuilder
.
client.addTask(UploadFileContentTask.create(). withContent("Hello World!"). withRemotePath("/remote/on/remote/remote.txt"). build());
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class com.sshtools.client.tasks.AbstractFileTask
AbstractFileTask.AbstractFileTaskBuilder<B extends AbstractFileTask.AbstractFileTaskBuilder<B,
T>, T extends AbstractConnectionTask> Nested classes/interfaces inherited from class com.sshtools.client.tasks.AbstractConnectionTask
AbstractConnectionTask.AbstractConnectionTaskBuilder<B extends AbstractConnectionTask.AbstractConnectionTaskBuilder<B,
T>, T extends AbstractConnectionTask> Nested classes/interfaces inherited from class com.sshtools.client.tasks.Task
Task.TaskRunnable<T>
-
Field Summary
Fields inherited from class com.sshtools.client.tasks.AbstractFileTask
progress
Fields inherited from class com.sshtools.client.tasks.AbstractConnectionTask
clientSupplier
Fields inherited from class com.sshtools.common.ssh.ConnectionAwareTask
con, lastError
-
Constructor Summary
ConstructorsConstructorDescriptionUploadFileContentTask
(SshClient ssh, String content, String encoding, String path) Deprecated, for removal: This API element is subject to removal in a future version.UploadFileContentTask
(com.sshtools.synergy.ssh.Connection<SshClientContext> con, String content, String encoding, String path) Deprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Methods inherited from class com.sshtools.client.tasks.AbstractFileTask
doTaskUntilDone
Methods inherited from class com.sshtools.client.tasks.Task
ofRunnable
Methods inherited from class com.sshtools.common.ssh.ConnectionAwareTask
getLastError, run
Methods inherited from class com.sshtools.common.ssh.AbstractRequestFuture
addFutureListener, done, isDone, isSuccess, waitFor, waitForever
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.sshtools.common.ssh.RequestFuture
isDoneAndSuccess
-
Constructor Details
-
UploadFileContentTask
@Deprecated(forRemoval=true, since="3.1.0") public UploadFileContentTask(SshClient ssh, String content, String encoding, String path) Deprecated, for removal: This API element is subject to removal in a future version.Construct a new upload content task. Deprecated since 3.1.0. Use aUploadFileContentTask.UploadFileContentTaskBuilder
instead.- Parameters:
con
- connectionlocalFile
- local fileremote
- remote- See Also:
-
UploadFileContentTask
@Deprecated(forRemoval=true, since="3.1.0") public UploadFileContentTask(com.sshtools.synergy.ssh.Connection<SshClientContext> con, String content, String encoding, String path) Deprecated, for removal: This API element is subject to removal in a future version.Construct a new upload content task. Deprecated since 3.1.0. Use aUploadFileContentTask.UploadFileContentTaskBuilder
instead.- Parameters:
con
- connectioncontent
- contentencoding
- encodingremote
- remote- See Also:
-
-
Method Details
-
doTask
public void doTask()- Specified by:
doTask
in classcom.sshtools.common.ssh.ConnectionAwareTask
-