public class ScpShell extends AbstractFileSystemCommand implements ServerChannelSessionHolder
| Modifier and Type | Class and Description |
|---|---|
protected static class |
ScpShell.PathEntry |
| Modifier and Type | Field and Description |
|---|---|
protected Path |
currentDir |
static String |
ENV_HOME
The "HOME" environment variable
|
static String |
ENV_LANG
Key for the language - format "en_US.UTF-8"
|
static String |
ENV_PWD
The "PWD" environment variable
|
protected Charset |
envVarsEnodingCharset |
protected Path |
homeDir |
protected ScpTransferEventListener |
listener |
protected Charset |
nameEncodingCharset |
protected ScpFileOpener |
opener |
protected int |
receiveBufferSize |
protected int |
sendBufferSize |
static String |
STATUS |
protected Map<String,Object> |
variables |
fileSystemcbCalled, cmdRunner, executorServicelog| Constructor and Description |
|---|
ScpShell(ChannelSession channelSession,
org.apache.sshd.common.util.threads.CloseableExecutorService executorService,
int sendSize,
int receiveSize,
ScpFileOpener fileOpener,
ScpTransferEventListener eventListener) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
cd(String[] argv) |
protected void |
doLs(String cmd,
String path,
boolean optListAll,
boolean optLong,
boolean optFullTime) |
protected void |
doScp(String path,
boolean optR,
boolean optT,
boolean optF,
boolean optD,
boolean optP) |
protected void |
echo(String[] argv) |
ChannelSession |
getServerChannelSession() |
protected boolean |
handleCommandLine(String command) |
protected void |
handleUnsupportedCommand(String command,
String[] argv) |
protected void |
ls(String[] argv) |
protected List<String[]> |
parse(String command) |
protected void |
prepareEnvironment(Environment environ) |
protected void |
printenv(String[] argv) |
protected void |
println(String cmd,
Object x,
OutputStream out,
Charset cs) |
protected void |
pwd(String[] argv) |
protected String |
readLine(Reader reader) |
protected String |
resolveEnvironmentVariable(String varName,
Map<String,String> envValues) |
void |
run() |
protected void |
scp(String[] argv) |
void |
setFileSystemFactory(org.apache.sshd.common.file.FileSystemFactory factory,
SessionContext session) |
protected void |
signalError(String cmd,
String errorMsg) |
protected void |
signalError(String cmd,
String errorMsg,
Charset cs) |
protected void |
unset(String[] argv) |
protected void |
updatePwdEnvVariable(Path pwd) |
destroy, getFileSystem, setFileSystemgetCommand, getEnvironment, getErrorStream, getExecutorService, getExitCallback, getInputStream, getOutputStream, getServerSession, getSession, getStartedCommandFuture, onExit, onExit, setErrorStream, setExitCallback, setInputStream, setOutputStream, setSession, start, toStringdebug, 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, waitgetSessionContextpublic static final String STATUS
public static final String ENV_PWD
public static final String ENV_HOME
public static final String ENV_LANG
protected final Charset nameEncodingCharset
protected final Charset envVarsEnodingCharset
protected final ScpFileOpener opener
protected final ScpTransferEventListener listener
protected final int sendBufferSize
protected final int receiveBufferSize
protected Path currentDir
protected Path homeDir
public ScpShell(ChannelSession channelSession, org.apache.sshd.common.util.threads.CloseableExecutorService executorService, int sendSize, int receiveSize, ScpFileOpener fileOpener, ScpTransferEventListener eventListener)
public ChannelSession getServerChannelSession()
getServerChannelSession in interface ServerChannelSessionHolderpublic void setFileSystemFactory(org.apache.sshd.common.file.FileSystemFactory factory, SessionContext session) throws IOException
setFileSystemFactory in interface org.apache.sshd.common.file.FileSystemAwareIOExceptionprotected void println(String cmd, Object x, OutputStream out, Charset cs)
protected String readLine(Reader reader) throws IOException
IOExceptionprotected boolean handleCommandLine(String command) throws Exception
Exceptionprotected void prepareEnvironment(Environment environ)
protected void handleUnsupportedCommand(String command, String[] argv) throws Exception
Exceptionprotected String resolveEnvironmentVariable(String varName, Map<String,String> envValues)
protected void doScp(String path, boolean optR, boolean optT, boolean optF, boolean optD, boolean optP) throws Exception
Exceptionprotected void updatePwdEnvVariable(Path pwd)
Copyright © 2018–2021 The Apache Software Foundation. All rights reserved.