com.maverick.scp
Class ScpClientIO.ScpEngineIO

java.lang.Object
  extended bycom.maverick.scp.ScpClientIO.ScpEngineIO
Direct Known Subclasses:
ScpClient.ScpEngine
Enclosing class:
ScpClientIO

public class ScpClientIO.ScpEngineIO
extends java.lang.Object

Implements an SCP engine.


Field Summary
protected  byte[] buffer
           
protected  java.lang.String cmd
           
protected  java.io.InputStream in
           
protected  java.io.OutputStream out
           
protected  SshSession session
           
 
Constructor Summary
protected ScpClientIO.ScpEngineIO(java.lang.String cmd, SshSession session)
           Contruct the channel with the specified scp command.
 
Method Summary
 void close()
          Close the SCP engine and underlying session.
protected  void parseCommand(java.lang.String cmd, java.lang.String[] cmdParts)
          Parse an SCP command
protected  void readCompleteFile(java.io.OutputStream out, long size, FileTransferProgress progress)
           
protected  java.io.InputStream readStreamFromRemote(java.lang.String remoteFile, FileTransferProgress progress)
          Open an InputStream.
protected  java.lang.String readString()
           
 void waitForResponse()
           
protected  void writeCompleteFile(java.io.InputStream in, long size, FileTransferProgress progress)
           
protected  void writeError(java.lang.String reason)
           
protected  void writeOk()
           
protected  void writeStreamToRemote(java.io.InputStream in, long length, java.lang.String localName, FileTransferProgress progress)
           Write a stream as a file to the remote server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

buffer

protected byte[] buffer

cmd

protected java.lang.String cmd

session

protected SshSession session

out

protected java.io.OutputStream out

in

protected java.io.InputStream in
Constructor Detail

ScpClientIO.ScpEngineIO

protected ScpClientIO.ScpEngineIO(java.lang.String cmd,
                                  SshSession session)
                           throws SshException

Contruct the channel with the specified scp command.

Parameters:
cmd - the scp command
session - the session to scp over
Method Detail

close

public void close()
           throws SshException
Close the SCP engine and underlying session.

Throws:
SshException

writeStreamToRemote

protected void writeStreamToRemote(java.io.InputStream in,
                                   long length,
                                   java.lang.String localName,
                                   FileTransferProgress progress)
                            throws java.io.IOException

Write a stream as a file to the remote server. You must supply the correct number of bytes that will be written.

Parameters:
in - stream
length - number of bytes to write
localName - local file name
Throws:
java.io.IOException - if an IO error occurs

readStreamFromRemote

protected java.io.InputStream readStreamFromRemote(java.lang.String remoteFile,
                                                   FileTransferProgress progress)
                                            throws java.io.IOException
Open an InputStream.

Returns:
Throws:
java.io.IOException

parseCommand

protected void parseCommand(java.lang.String cmd,
                            java.lang.String[] cmdParts)
                     throws java.io.IOException
Parse an SCP command

Parameters:
cmd -
cmdParts -
Throws:
java.io.IOException

readString

protected java.lang.String readString()
                               throws java.io.IOException
Throws:
java.io.IOException

waitForResponse

public void waitForResponse()
                     throws java.io.IOException
Throws:
java.io.IOException

writeOk

protected void writeOk()
                throws java.io.IOException
Throws:
java.io.IOException

writeError

protected void writeError(java.lang.String reason)
                   throws java.io.IOException
Throws:
java.io.IOException

writeCompleteFile

protected void writeCompleteFile(java.io.InputStream in,
                                 long size,
                                 FileTransferProgress progress)
                          throws java.io.IOException
Throws:
java.io.IOException

readCompleteFile

protected void readCompleteFile(java.io.OutputStream out,
                                long size,
                                FileTransferProgress progress)
                         throws java.io.IOException
Throws:
java.io.IOException


Copyright © 2003 3SP LTD. All Rights Reserved.