Package com.sshtools.common.scp
Class ScpCommand
java.lang.Object
com.sshtools.common.command.AbstractExecutableCommand
com.sshtools.common.scp.ScpCommand
- All Implemented Interfaces:
ExecutableCommand,Component,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);
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface com.sshtools.common.command.ExecutableCommand
ExecutableCommand.ExecutableCommandFactory<T extends ExecutableCommand> -
Field Summary
Fields inherited from class com.sshtools.common.command.AbstractExecutableCommand
sessionFields inherited from interface com.sshtools.common.command.ExecutableCommand
STILL_ACTIVE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidbooleancreateProcess(String[] args, Map<String, String> environment) Parse the SCP command line and configure the command ready for execution.intGet the exit code for this process.voidkill()Called when channel is closingvoidonStart()Start the process.voidrun()Methods inherited from class com.sshtools.common.command.AbstractExecutableCommand
allocatePseudoTerminal, getInputStream, getOutputStream, getSession, getStderrOutputStream, init, start
-
Constructor Details
-
ScpCommand
public ScpCommand() -
ScpCommand
Creates a new ScpCommand object.
-
-
Method Details
-
createProcess
Parse the SCP command line and configure the command ready for execution.- Specified by:
createProcessin interfaceExecutableCommand- Specified by:
createProcessin classAbstractExecutableCommand- Parameters:
command-environment-- Returns:
- boolean
-
getExitCode
public int getExitCode()Description copied from class:AbstractExecutableCommandGet the exit code for this process. If the process has not completed returnExecutableCommand.STILL_ACTIVE.- Specified by:
getExitCodein interfaceExecutableCommand- Specified by:
getExitCodein classAbstractExecutableCommand- Returns:
- int
-
kill
public void kill()Called when channel is closing- Specified by:
killin interfaceExecutableCommand- Specified by:
killin classAbstractExecutableCommand
-
onStart
public void onStart()Start the process.- Specified by:
onStartin interfaceExecutableCommand- Specified by:
onStartin classAbstractExecutableCommand- Throws:
IOException
-
run
public void run() -
closeSession
protected void closeSession()
-