public class ScpClientIO
extends java.lang.Object
Implements the IO of a Secure Copy (SCP) client. This has no dependencies upon Files.
Modifier and Type | Class and Description |
---|---|
class |
ScpClientIO.ScpEngineIO
Implements an SCP engine.
|
Constructor and Description |
---|
ScpClientIO(SshClient ssh)
Creates an SCP client.
|
Modifier and Type | Method and Description |
---|---|
java.io.InputStream |
get(java.lang.String remoteFile)
Gets a remote file as a
java.io.InputStream . |
java.io.InputStream |
get(java.lang.String remoteFile,
FileTransferProgress progress)
Gets a remote file as a
java.io.InputStream . |
void |
put(java.io.InputStream in,
long length,
java.lang.String localFile,
java.lang.String remoteFile)
Uploads a
java.io.InputStream to a remote server as a file. |
void |
put(java.io.InputStream in,
long length,
java.lang.String localFile,
java.lang.String remoteFile,
boolean remoteIsDir,
FileTransferProgress progress) |
void |
put(java.io.InputStream in,
long length,
java.lang.String localFile,
java.lang.String remoteFile,
FileTransferProgress progress)
Uploads a
java.io.InputStream to a remote server as a file. |
protected SshClient ssh
public ScpClientIO(SshClient ssh)
Creates an SCP client.
ssh
- a connected SshClientpublic void put(java.io.InputStream in, long length, java.lang.String localFile, java.lang.String remoteFile) throws com.sshtools.common.ssh.SshException, com.sshtools.common.ssh.ChannelOpenException
Uploads a java.io.InputStream
to a remote server as a file.
You must supply the correct number of bytes that will be
written.
in
- stream providing filelength
- number of bytes that will be writtenlocalFile
- local file nameremoteFile
- remote file namejava.io.IOException
- on any errorcom.sshtools.common.ssh.SshException
com.sshtools.common.ssh.ChannelOpenException
public void put(java.io.InputStream in, long length, java.lang.String localFile, java.lang.String remoteFile, FileTransferProgress progress) throws com.sshtools.common.ssh.SshException, com.sshtools.common.ssh.ChannelOpenException
Uploads a java.io.InputStream
to a remote server as a file.
You must supply the correct number of bytes that will be
written.
in
- stream providing filelength
- number of bytes that will be writtenlocalFile
- local file nameremoteFile
- remote file nameprogress
- a file transfer progress implementationjava.io.IOException
- on any errorcom.sshtools.common.ssh.SshException
com.sshtools.common.ssh.ChannelOpenException
public void put(java.io.InputStream in, long length, java.lang.String localFile, java.lang.String remoteFile, boolean remoteIsDir, FileTransferProgress progress) throws com.sshtools.common.ssh.SshException, com.sshtools.common.ssh.ChannelOpenException
in
- length
- localFile
- remoteFile
- remoteIsDir
- progress
- com.sshtools.common.ssh.SshException
com.sshtools.common.ssh.ChannelOpenException
public java.io.InputStream get(java.lang.String remoteFile) throws com.sshtools.common.ssh.SshException, com.sshtools.common.ssh.ChannelOpenException
Gets a remote file as a java.io.InputStream
.
remoteFile
- remote file namejava.io.IOException
- on any errorcom.sshtools.common.ssh.SshException
com.sshtools.common.ssh.ChannelOpenException
public java.io.InputStream get(java.lang.String remoteFile, FileTransferProgress progress) throws com.sshtools.common.ssh.SshException, com.sshtools.common.ssh.ChannelOpenException
Gets a remote file as a java.io.InputStream
.
remoteFile
- remote file nameprogress
- a file transfer progress implementation.java.io.IOException
- on any errorcom.sshtools.common.ssh.SshException
com.sshtools.common.ssh.ChannelOpenException
Copyright © 2021. All rights reserved.