com.maverick.scp
Class ScpClientIO

java.lang.Object
  extended bycom.maverick.scp.ScpClientIO
Direct Known Subclasses:
ScpClient

public class ScpClientIO
extends java.lang.Object

Implements the IO of a Secure Copy (SCP) client. This has no dependencies upon Files.

Author:
Lee David Painter

Nested Class Summary
 class ScpClientIO.ScpEngineIO
           Implements an SCP engine.
 
Field Summary
protected  SshClient ssh
           
 
Constructor Summary
ScpClientIO(SshClient ssh)
           Creates an SCP client.
 
Method Summary
 java.io.InputStream get(java.lang.String remoteFile)
           Gets a remote file as an java.io.InputStream.
 java.io.InputStream get(java.lang.String remoteFile, FileTransferProgress progress)
           Gets a remote file as an 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 remove server as file.
 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 remove server as file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ssh

protected SshClient ssh
Constructor Detail

ScpClientIO

public ScpClientIO(SshClient ssh)

Creates an SCP client.

Parameters:
ssh - a connected SshClient
Method Detail

put

public void put(java.io.InputStream in,
                long length,
                java.lang.String localFile,
                java.lang.String remoteFile)
         throws SshException,
                ChannelOpenException

Uploads a java.io.InputStream to a remove server as file. You must supply the correct number of bytes that will be written.

Parameters:
in - stream providing file
length - number of bytes that will be written
localFile - local file name
remoteFile - remote file name
Throws:
java.io.IOException - on any error
SshException
ChannelOpenException

put

public void put(java.io.InputStream in,
                long length,
                java.lang.String localFile,
                java.lang.String remoteFile,
                FileTransferProgress progress)
         throws SshException,
                ChannelOpenException

Uploads a java.io.InputStream to a remove server as file. You must supply the correct number of bytes that will be written.

Parameters:
in - stream providing file
length - number of bytes that will be written
localFile - local file name
remoteFile - remote file name
progress - a file transfer progress implementation
Throws:
java.io.IOException - on any error
SshException
ChannelOpenException

get

public java.io.InputStream get(java.lang.String remoteFile)
                        throws SshException,
                               ChannelOpenException

Gets a remote file as an java.io.InputStream.

Parameters:
remoteFile - remote file name
Returns:
Throws:
java.io.IOException - on any error
SshException
ChannelOpenException

get

public java.io.InputStream get(java.lang.String remoteFile,
                               FileTransferProgress progress)
                        throws SshException,
                               ChannelOpenException

Gets a remote file as an java.io.InputStream.

Parameters:
remoteFile - remote file name
progress - a file transfer progress implementation.
Returns:
Throws:
java.io.IOException - on any error
SshException
ChannelOpenException


Copyright © 2003 3SP LTD. All Rights Reserved.