com.maverick.sshd.scp
Class ScpCommand

java.lang.Object
  extended by com.maverick.sshd.platform.ExecutableCommand
      extended by com.maverick.sshd.scp.ScpCommand
All Implemented Interfaces:
java.lang.Runnable

public class ScpCommand
extends ExecutableCommand
implements java.lang.Runnable

Provides support for the SCP command. To enable this support add this class in the com.maverick.sshd.SshDaemon#configure(com.maverick.sshd.ConfigurationContext) method using the following code

 context.addCommand("scp", ScpCommand.class);
 


Field Summary
 
Fields inherited from class com.maverick.sshd.platform.ExecutableCommand
session, stderr, stdin, stdout, STILL_ACTIVE
 
Constructor Summary
ScpCommand()
          Creates a new ScpCommand object.
 
Method Summary
protected  FilenamePattern createFilenamePattern(java.lang.String pattern)
          Creates a FilenamePattern.
 boolean createProcess(java.lang.String command, java.util.Map environment)
          Parse the SCP command line and configure the command ready for execution.
 int getExitCode()
          Get the exit code for this process.
 void kill()
          Called when channel is closing
 void onStart()
          Start the process.
 void run()
           
 
Methods inherited from class com.maverick.sshd.platform.ExecutableCommand
getInputStream, getOutputStream, getStderrOutputStream, init, processStdinData, start
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScpCommand

public ScpCommand()
Creates a new ScpCommand object.

Method Detail

createProcess

public boolean createProcess(java.lang.String command,
                             java.util.Map environment)
Parse the SCP command line and configure the command ready for execution.

Specified by:
createProcess in class ExecutableCommand
Parameters:
command -
environment -
Returns:
boolean

getExitCode

public int getExitCode()
Description copied from class: ExecutableCommand
Get the exit code for this process. If the process has not completed return ExecutableCommand.STILL_ACTIVE.

Specified by:
getExitCode in class ExecutableCommand
Returns:
int

kill

public void kill()
Called when channel is closing

Specified by:
kill in class ExecutableCommand

onStart

public void onStart()
Start the process.

Specified by:
onStart in class ExecutableCommand
Throws:
java.io.IOException

createFilenamePattern

protected FilenamePattern createFilenamePattern(java.lang.String pattern)
Creates a FilenamePattern. Override to customize pattern matching behaviour.

Parameters:
pattern - String
Returns:
FilenamePattern

run

public void run()
Specified by:
run in interface java.lang.Runnable


Copyright © 2003-2008 SSHTools LTD. All Rights Reserved.