Package org.apache.sshd.scp.server
Class ScpCommand
java.lang.Object
org.apache.sshd.common.util.logging.AbstractLoggingBean
org.apache.sshd.server.command.AbstractCommandSupport
org.apache.sshd.server.command.AbstractFileSystemCommand
org.apache.sshd.scp.server.ScpCommand
- All Implemented Interfaces:
Runnable,org.apache.sshd.common.file.FileSystemAware,org.apache.sshd.common.session.SessionContextHolder,org.apache.sshd.common.session.SessionHolder<org.apache.sshd.server.session.ServerSession>,org.apache.sshd.common.util.threads.ExecutorServiceCarrier,org.apache.sshd.server.channel.ServerChannelSessionHolder,org.apache.sshd.server.command.Command,org.apache.sshd.server.command.CommandDirectErrorStreamAware,org.apache.sshd.server.command.CommandDirectInputStreamAware,org.apache.sshd.server.command.CommandDirectOutputStreamAware,org.apache.sshd.server.command.CommandDirectStreamsAware,org.apache.sshd.server.command.CommandLifecycle,org.apache.sshd.server.session.ServerSessionAware,org.apache.sshd.server.session.ServerSessionHolder
public class ScpCommand
extends org.apache.sshd.server.command.AbstractFileSystemCommand
implements org.apache.sshd.server.channel.ServerChannelSessionHolder
This commands provide SCP support on both server and client side. Permissions and preservation of access /
modification times on files are not supported.
- Author:
- Apache MINA SSHD Project
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected IOExceptionprotected ScpTransferEventListenerprotected final ScpFileOpenerprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected Stringprotected final intprotected final intFields inherited from class org.apache.sshd.server.command.AbstractFileSystemCommand
fileSystemFields inherited from class org.apache.sshd.server.command.AbstractCommandSupport
cbCalled, cmdRunner, executorServiceFields inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
log -
Constructor Summary
ConstructorsConstructorDescriptionScpCommand(org.apache.sshd.server.channel.ChannelSession channelSession, String command, org.apache.sshd.common.util.threads.CloseableExecutorService executorService, int sendSize, int receiveSize, ScpFileOpener fileOpener, ScpTransferEventListener eventListener) -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.sshd.server.channel.ChannelSessionvoidrun()voidstart(org.apache.sshd.server.channel.ChannelSession channel, org.apache.sshd.server.Environment env) toString()protected voidwriteCommandResponseMessage(String command, int exitValue, String exitMessage) Methods inherited from class org.apache.sshd.server.command.AbstractFileSystemCommand
destroy, getFileSystem, setFileSystemMethods inherited from class org.apache.sshd.server.command.AbstractCommandSupport
getCommand, getEnvironment, getErrorStream, getExecutorService, getExitCallback, getInputStream, getOutputStream, getServerSession, getSession, getStartedCommandFuture, onExit, onExit, setErrorStream, setExitCallback, setInputStream, setOutputStream, setSessionMethods inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
debug, debug, debug, debug, debug, error, error, error, error, error, getSimplifiedLogger, info, info, warn, warn, warn, warn, warn, warn, warn, warnMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.sshd.common.file.FileSystemAware
setFileSystemFactoryMethods inherited from interface org.apache.sshd.common.session.SessionHolder
getSessionContext
-
Field Details
-
sendBufferSize
protected final int sendBufferSize -
receiveBufferSize
protected final int receiveBufferSize -
opener
-
optR
protected boolean optR -
optT
protected boolean optT -
optF
protected boolean optF -
optD
protected boolean optD -
optP
protected boolean optP -
path
-
error
-
listener
-
-
Constructor Details
-
ScpCommand
public ScpCommand(org.apache.sshd.server.channel.ChannelSession channelSession, String command, org.apache.sshd.common.util.threads.CloseableExecutorService executorService, int sendSize, int receiveSize, ScpFileOpener fileOpener, ScpTransferEventListener eventListener) - Parameters:
channelSession- TheChannelSessionthrough which the command was receivedcommand- The command to be executedexecutorService- AnCloseableExecutorServiceto be used whenstart(ChannelSession, Environment)-ing execution. Ifnullan 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- TheScpFileOpener- ifnullthenDefaultScpFileOpeneris usedeventListener- AnScpTransferEventListener- may benull- See Also:
-
-
Method Details
-
getServerChannelSession
public org.apache.sshd.server.channel.ChannelSession getServerChannelSession()- Specified by:
getServerChannelSessionin interfaceorg.apache.sshd.server.channel.ServerChannelSessionHolder
-
start
public void start(org.apache.sshd.server.channel.ChannelSession channel, org.apache.sshd.server.Environment env) throws IOException - Specified by:
startin interfaceorg.apache.sshd.server.command.CommandLifecycle- Overrides:
startin classorg.apache.sshd.server.command.AbstractCommandSupport- Throws:
IOException
-
run
public void run() -
writeCommandResponseMessage
protected void writeCommandResponseMessage(String command, int exitValue, String exitMessage) throws IOException - Throws:
IOException
-
toString
- Overrides:
toStringin classorg.apache.sshd.server.command.AbstractCommandSupport
-