org.apache.maven.wagon.providers.ssh
Class ScpCommand

java.lang.Object
  extended by org.apache.maven.wagon.providers.ssh.ScpCommand
All Implemented Interfaces:
Runnable, org.apache.sshd.server.Command, org.apache.sshd.server.FileSystemAware

public class ScpCommand
extends Object
implements org.apache.sshd.server.Command, Runnable, org.apache.sshd.server.FileSystemAware

This commands provide SCP support on both server and client side. Permissions and preservation of access / modification times on files are not supported. olamy : copy of a class from mina for changing return codes in case of file not found 1 warning instead of 2

Author:
Apache MINA SSHD Project

Field Summary
protected  org.apache.sshd.server.ExitCallback callback
           
protected  OutputStream err
           
protected  IOException error
           
protected static int ERROR
           
protected  InputStream in
           
protected static org.slf4j.Logger log
           
protected  String name
           
protected static int OK
           
protected  boolean optD
           
protected  boolean optF
           
protected  boolean optP
           
protected  boolean optR
           
protected  boolean optT
           
protected  boolean optV
           
protected  OutputStream out
           
protected  String path
           
protected  org.apache.sshd.server.FileSystemView root
           
protected static int WARNING
           
 
Constructor Summary
ScpCommand(String[] args)
           
 
Method Summary
protected  void ack()
           
 void destroy()
           
protected  int readAck(boolean canEof)
           
protected  void readDir(org.apache.sshd.server.SshFile path)
           
protected  void readFile(org.apache.sshd.server.SshFile path)
           
protected  String readLine()
           
 void run()
           
 void setErrorStream(OutputStream err)
           
 void setExitCallback(org.apache.sshd.server.ExitCallback callback)
           
 void setFileSystemView(org.apache.sshd.server.FileSystemView view)
           
 void setInputStream(InputStream in)
           
 void setOutputStream(OutputStream out)
           
 void start(org.apache.sshd.server.Environment env)
           
protected  void writeDir(String header, org.apache.sshd.server.SshFile path)
           
protected  void writeFile(String header, org.apache.sshd.server.SshFile path)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static final org.slf4j.Logger log

OK

protected static final int OK
See Also:
Constant Field Values

WARNING

protected static final int WARNING
See Also:
Constant Field Values

ERROR

protected static final int ERROR
See Also:
Constant Field Values

name

protected String name

optR

protected boolean optR

optT

protected boolean optT

optF

protected boolean optF

optV

protected boolean optV

optD

protected boolean optD

optP

protected boolean optP

root

protected org.apache.sshd.server.FileSystemView root

path

protected String path

in

protected InputStream in

out

protected OutputStream out

err

protected OutputStream err

callback

protected org.apache.sshd.server.ExitCallback callback

error

protected IOException error
Constructor Detail

ScpCommand

public ScpCommand(String[] args)
Method Detail

setInputStream

public void setInputStream(InputStream in)
Specified by:
setInputStream in interface org.apache.sshd.server.Command

setOutputStream

public void setOutputStream(OutputStream out)
Specified by:
setOutputStream in interface org.apache.sshd.server.Command

setErrorStream

public void setErrorStream(OutputStream err)
Specified by:
setErrorStream in interface org.apache.sshd.server.Command

setExitCallback

public void setExitCallback(org.apache.sshd.server.ExitCallback callback)
Specified by:
setExitCallback in interface org.apache.sshd.server.Command

start

public void start(org.apache.sshd.server.Environment env)
           throws IOException
Specified by:
start in interface org.apache.sshd.server.Command
Throws:
IOException

destroy

public void destroy()
Specified by:
destroy in interface org.apache.sshd.server.Command

run

public void run()
Specified by:
run in interface Runnable

writeDir

protected void writeDir(String header,
                        org.apache.sshd.server.SshFile path)
                 throws IOException
Throws:
IOException

writeFile

protected void writeFile(String header,
                         org.apache.sshd.server.SshFile path)
                  throws IOException
Throws:
IOException

readLine

protected String readLine()
                   throws IOException
Throws:
IOException

readFile

protected void readFile(org.apache.sshd.server.SshFile path)
                 throws IOException
Throws:
IOException

readDir

protected void readDir(org.apache.sshd.server.SshFile path)
                throws IOException
Throws:
IOException

ack

protected void ack()
            throws IOException
Throws:
IOException

readAck

protected int readAck(boolean canEof)
               throws IOException
Throws:
IOException

setFileSystemView

public void setFileSystemView(org.apache.sshd.server.FileSystemView view)
Specified by:
setFileSystemView in interface org.apache.sshd.server.FileSystemAware


Copyright © 2003-2011 The Apache Software Foundation. All Rights Reserved.