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.voidput(InputStream in, long length, String localFile, String remoteFile) Uploads ajava.io.InputStreamto a remote server as a file.voidput(InputStream in, long length, String localFile, String remoteFile, boolean remoteIsDir, FileTransferProgress progress) voidput(InputStream in, long length, String localFile, String remoteFile, FileTransferProgress progress) Uploads ajava.io.InputStreamto 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 SshException, ChannelOpenException Uploads a
java.io.InputStreamto 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 errorSshExceptionChannelOpenException
-
put
public void put(InputStream in, long length, String localFile, String remoteFile, FileTransferProgress progress) throws SshException, ChannelOpenException Uploads a
java.io.InputStreamto 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 errorSshExceptionChannelOpenException
-
put
public void put(InputStream in, long length, String localFile, String remoteFile, boolean remoteIsDir, FileTransferProgress progress) throws SshException, ChannelOpenException - Parameters:
in-length-localFile-remoteFile-remoteIsDir-progress-- Throws:
SshExceptionChannelOpenException
-
get
Gets a remote file as a
java.io.InputStream.- Parameters:
remoteFile- remote file name- Returns:
- ScpInputStream
- Throws:
IOException- on any errorSshExceptionChannelOpenException
-
get
public InputStream get(String remoteFile, FileTransferProgress progress) throws SshException, 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 errorSshExceptionChannelOpenException
-