public class ScpCommand extends AbstractFileSystemCommand implements ServerChannelSessionHolder
| Modifier and Type | Field and Description |
|---|---|
private ChannelSession |
channelSession |
protected java.io.IOException |
error |
protected ScpTransferEventListener |
listener |
protected ScpFileOpener |
opener |
protected boolean |
optD |
protected boolean |
optF |
protected boolean |
optP |
protected boolean |
optR |
protected boolean |
optT |
protected java.lang.String |
path |
protected int |
receiveBufferSize |
protected int |
sendBufferSize |
fileSystemcbCalled, cmdRunner, executorServicelog| Constructor and Description |
|---|
ScpCommand(ChannelSession channelSession,
java.lang.String command,
CloseableExecutorService executorService,
int sendSize,
int receiveSize,
ScpFileOpener fileOpener,
ScpTransferEventListener eventListener) |
| Modifier and Type | Method and Description |
|---|---|
ChannelSession |
getServerChannelSession() |
void |
run() |
void |
start(ChannelSession channel,
Environment env)
Starts the command execution.
|
java.lang.String |
toString() |
protected void |
writeCommandResponseMessage(java.lang.String command,
int exitValue,
java.lang.String exitMessage) |
destroy, getFileSystem, setFileSystemgetCommand, getEnvironment, getErrorStream, getExecutorService, getExitCallback, getInputStream, getOutputStream, getServerSession, getSession, getStartedCommandFuture, onExit, onExit, setErrorStream, setExitCallback, setInputStream, setOutputStream, setSessiondebug, debug, debug, debug, debug, error, error, error, error, error, getSimplifiedLogger, info, info, warn, warn, warn, warn, warn, warn, warn, warnclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitsetFileSystemFactorygetSessionContextprotected final int sendBufferSize
protected final int receiveBufferSize
protected final ScpFileOpener opener
protected boolean optR
protected boolean optT
protected boolean optF
protected boolean optD
protected boolean optP
protected java.lang.String path
protected java.io.IOException error
protected ScpTransferEventListener listener
private final ChannelSession channelSession
public ScpCommand(ChannelSession channelSession, java.lang.String command, CloseableExecutorService executorService, int sendSize, int receiveSize, ScpFileOpener fileOpener, ScpTransferEventListener eventListener)
channelSession - The ChannelSession through which the command was receivedcommand - The command to be executedexecutorService - An CloseableExecutorService to be used when
start(ChannelSession, Environment)-ing execution. If null an ad-hoc
single-threaded service is created and used.sendSize - Size (in bytes) of buffer to use when sending filesreceiveSize - Size (in bytes) of buffer to use when receiving filesfileOpener - The ScpFileOpener - if null then DefaultScpFileOpener is usedeventListener - An ScpTransferEventListener - may be nullThreadUtils.newSingleThreadExecutor(String),
ScpHelper.MIN_SEND_BUFFER_SIZE,
ScpHelper.MIN_RECEIVE_BUFFER_SIZEpublic ChannelSession getServerChannelSession()
getServerChannelSession in interface ServerChannelSessionHolderpublic void start(ChannelSession channel, Environment env) throws java.io.IOException
CommandLifecycleRunnable, and this method should spawn a new thread like:
Thread(this).start();
start in interface CommandLifecyclestart in class AbstractCommandSupportchannel - The ChannelSession through which the command has been receivedenv - The Environmentjava.io.IOException - If failed to startpublic void run()
run in interface java.lang.Runnableprotected void writeCommandResponseMessage(java.lang.String command,
int exitValue,
java.lang.String exitMessage)
throws java.io.IOException
java.io.IOExceptionpublic java.lang.String toString()
toString in class AbstractCommandSupport