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 |
fileSystem
cbCalled, cmdRunner, executorService
log
Constructor and Description |
---|
ScpShell(ChannelSession channelSession,
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(FileSystemFactory factory,
SessionContext session)
Sets the
FileSystemFactory used to create the FileSystem to be used by the 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, setFileSystem
getCommand, getEnvironment, getErrorStream, getExecutorService, getExitCallback, getInputStream, getOutputStream, getServerSession, getSession, getStartedCommandFuture, onExit, onExit, setErrorStream, setExitCallback, setInputStream, setOutputStream, setSession, start, toString
debug, debug, debug, debug, debug, error, error, error, error, error, getSimplifiedLogger, info, info, warn, warn, warn, warn, warn, warn, warn, warn
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getSessionContext
public 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, CloseableExecutorService executorService, int sendSize, int receiveSize, ScpFileOpener fileOpener, ScpTransferEventListener eventListener)
public ChannelSession getServerChannelSession()
getServerChannelSession
in interface ServerChannelSessionHolder
public void setFileSystemFactory(FileSystemFactory factory, SessionContext session) throws IOException
FileSystemAware
FileSystemFactory
used to create the FileSystem
to be used by the sessionsetFileSystemFactory
in interface FileSystemAware
factory
- The factory instancesession
- The SessionContext
IOException
- If failed to resolve/create the file systemFileSystemAware.setFileSystem(FileSystem)
protected void println(String cmd, Object x, OutputStream out, Charset cs)
protected String readLine(Reader reader) throws IOException
IOException
protected boolean handleCommandLine(String command) throws Exception
Exception
protected void prepareEnvironment(Environment environ)
protected void handleUnsupportedCommand(String command, String[] argv) throws Exception
Exception
protected 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
Exception
protected void updatePwdEnvVariable(Path pwd)
Copyright © 2008–2024 The Apache Software Foundation. All rights reserved.