Package com.sshtools.client.scp
Class ScpClientIO
java.lang.Object
com.sshtools.client.scp.ScpClientIO
- Direct Known Subclasses:
ScpClient
Implements the IO of a Secure Copy (SCP) client. This has no dependencies upon Files.
- Author:
- Lee David Painter
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets a remote file as ajava.io.InputStream
.get
(String remoteFile, FileTransferProgress progress) Gets a remote file as ajava.io.InputStream
.void
put
(InputStream in, long length, String localFile, String remoteFile) Uploads ajava.io.InputStream
to a remote server as a file.void
put
(InputStream in, long length, String localFile, String remoteFile, boolean remoteIsDir, FileTransferProgress progress) void
put
(InputStream in, long length, String localFile, String remoteFile, FileTransferProgress progress) Uploads ajava.io.InputStream
to a remote server as a file.
-
Field Details
-
ssh
-
-
Constructor Details
-
ScpClientIO
Creates an SCP client.
- Parameters:
ssh
- a connected SshClient
-
-
Method Details
-
put
public void put(InputStream in, long length, String localFile, 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.- Parameters:
in
- stream providing filelength
- number of bytes that will be writtenlocalFile
- local file nameremoteFile
- remote file name- Throws:
IOException
- on any errorcom.sshtools.common.ssh.SshException
com.sshtools.common.ssh.ChannelOpenException
-
put
public void put(InputStream in, long length, String localFile, 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.- Parameters:
in
- stream providing filelength
- number of bytes that will be writtenlocalFile
- local file nameremoteFile
- remote file nameprogress
- a file transfer progress implementation- Throws:
IOException
- on any errorcom.sshtools.common.ssh.SshException
com.sshtools.common.ssh.ChannelOpenException
-
put
public void put(InputStream in, long length, String localFile, String remoteFile, boolean remoteIsDir, FileTransferProgress progress) throws com.sshtools.common.ssh.SshException, com.sshtools.common.ssh.ChannelOpenException - Parameters:
in
-length
-localFile
-remoteFile
-remoteIsDir
-progress
-- Throws:
com.sshtools.common.ssh.SshException
com.sshtools.common.ssh.ChannelOpenException
-
get
public InputStream get(String remoteFile) throws com.sshtools.common.ssh.SshException, com.sshtools.common.ssh.ChannelOpenException Gets a remote file as a
java.io.InputStream
.- Parameters:
remoteFile
- remote file name- Returns:
- ScpInputStream
- Throws:
IOException
- on any errorcom.sshtools.common.ssh.SshException
com.sshtools.common.ssh.ChannelOpenException
-
get
public InputStream get(String remoteFile, FileTransferProgress progress) throws com.sshtools.common.ssh.SshException, com.sshtools.common.ssh.ChannelOpenException Gets a remote file as a
java.io.InputStream
.- Parameters:
remoteFile
- remote file nameprogress
- a file transfer progress implementation.- Returns:
- ScpInputStream
- Throws:
IOException
- on any errorcom.sshtools.common.ssh.SshException
com.sshtools.common.ssh.ChannelOpenException
-