Class ScpShell
- All Implemented Interfaces:
Runnable, FileSystemAware, SessionContextHolder, SessionHolder<ServerSession>, ExecutorServiceCarrier, ServerChannelSessionHolder, Command, CommandDirectErrorStreamAware, CommandDirectInputStreamAware, CommandDirectOutputStreamAware, CommandDirectStreamsAware, CommandLifecycle, ServerSessionAware, ServerSessionHolder
This command provides SCP support for a ChannelSession.
- Author:
- Apache MINA SSHD Project
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Pathstatic final StringThe "HOME" environment variablestatic final StringKey for the language - format "en_US.UTF-8"static final StringThe "PWD" environment variableprotected final Charsetprotected Pathprotected final ScpTransferEventListenerprotected final Charsetprotected final ScpFileOpenerprotected final intprotected final intstatic final StringFields inherited from class AbstractFileSystemCommand
fileSystemFields inherited from class AbstractCommandSupport
cbCalled, cmdRunner, executorServiceFields inherited from class AbstractLoggingBean
log -
Constructor Summary
ConstructorsConstructorDescriptionScpShell(ChannelSession channelSession, CloseableExecutorService executorService, int sendSize, int receiveSize, ScpFileOpener fileOpener, ScpTransferEventListener eventListener) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected voidprotected voidprotected voidprotected booleanhandleCommandLine(String command) protected voidhandleUnsupportedCommand(String command, String[] argv) protected voidprotected voidprepareEnvironment(Environment environ) protected voidprotected voidprintln(String cmd, Object x, OutputStream out, Charset cs) protected voidprotected Stringprotected StringresolveEnvironmentVariable(String varName, Map<String, String> envValues) voidrun()protected voidvoidsetFileSystemFactory(FileSystemFactory factory, SessionContext session) Sets theFileSystemFactoryused to create theFileSystemto be used by the sessionprotected voidsignalError(String cmd, String errorMsg) protected voidsignalError(String cmd, String errorMsg, Charset cs) protected voidprotected voidupdatePwdEnvVariable(Path pwd) Methods inherited from class AbstractFileSystemCommand
destroy, getFileSystem, setFileSystemMethods inherited from class AbstractCommandSupport
getCommand, getEnvironment, getErrorStream, getExecutorService, getExitCallback, getInputStream, getOutputStream, getServerSession, getSession, getStartedCommandFuture, onExit, onExit, setErrorStream, setExitCallback, setInputStream, setOutputStream, setSession, start, toStringMethods inherited from class 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 Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface SessionHolder
getSessionContext
-
Field Details
-
STATUS
- See Also:
-
ENV_PWD
-
ENV_HOME
-
ENV_LANG
-
variables
-
nameEncodingCharset
-
envVarsEnodingCharset
-
opener
-
listener
-
sendBufferSize
protected final int sendBufferSize -
receiveBufferSize
protected final int receiveBufferSize -
currentDir
-
homeDir
-
-
Constructor Details
-
ScpShell
public ScpShell(ChannelSession channelSession, CloseableExecutorService executorService, int sendSize, int receiveSize, ScpFileOpener fileOpener, ScpTransferEventListener eventListener)
-
-
Method Details
-
getServerChannelSession
- Specified by:
getServerChannelSessionin interfaceServerChannelSessionHolder
-
setFileSystemFactory
public void setFileSystemFactory(FileSystemFactory factory, SessionContext session) throws IOException Description copied from interface:FileSystemAwareSets theFileSystemFactoryused to create theFileSystemto be used by the session- Specified by:
setFileSystemFactoryin interfaceFileSystemAware- Parameters:
factory- The factory instancesession- TheSessionContext- Throws:
IOException- If failed to resolve/create the file system- See Also:
-
println
-
signalError
-
signalError
-
run
-
readLine
- Throws:
IOException
-
handleCommandLine
-
prepareEnvironment
-
handleUnsupportedCommand
-
parse
-
printenv
-
resolveEnvironmentVariable
-
unset
-
scp
-
doScp
-
echo
-
pwd
-
cd
-
updatePwdEnvVariable
-
ls
-
doLs
-