Package org.apache.sshd.server.command
Class AbstractFileSystemCommand
- java.lang.Object
-
- org.apache.sshd.common.util.logging.AbstractLoggingBean
-
- org.apache.sshd.server.command.AbstractCommandSupport
-
- org.apache.sshd.server.command.AbstractFileSystemCommand
-
- All Implemented Interfaces:
java.lang.Runnable
,FileSystemAware
,SessionContextHolder
,SessionHolder<ServerSession>
,ExecutorServiceCarrier
,Command
,CommandDirectErrorStreamAware
,CommandDirectInputStreamAware
,CommandDirectOutputStreamAware
,CommandDirectStreamsAware
,CommandLifecycle
,ServerSessionAware
,ServerSessionHolder
- Direct Known Subclasses:
ScpCommand
,ScpShell
public abstract class AbstractFileSystemCommand extends AbstractCommandSupport implements FileSystemAware
Provides a basic useful skeleton forCommand
executions that require file system access
-
-
Field Summary
Fields Modifier and Type Field Description protected java.nio.file.FileSystem
fileSystem
-
Fields inherited from class org.apache.sshd.server.command.AbstractCommandSupport
cbCalled, cmdRunner, executorService
-
Fields inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
log
-
-
Constructor Summary
Constructors Constructor Description AbstractFileSystemCommand(java.lang.String command, CloseableExecutorService executorService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
destroy(ChannelSession channel)
This method is called by the SSH server to destroy the command because the client has disconnected somehow.java.nio.file.FileSystem
getFileSystem()
void
setFileSystem(java.nio.file.FileSystem fileSystem)
Set the file system in which this shell will be executed.-
Methods 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, setSession, start, toString
-
Methods 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, warn
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.sshd.common.file.FileSystemAware
setFileSystemFactory
-
Methods inherited from interface org.apache.sshd.common.session.SessionHolder
getSessionContext
-
-
-
-
Constructor Detail
-
AbstractFileSystemCommand
public AbstractFileSystemCommand(java.lang.String command, CloseableExecutorService executorService)
-
-
Method Detail
-
getFileSystem
public java.nio.file.FileSystem getFileSystem()
-
setFileSystem
public void setFileSystem(java.nio.file.FileSystem fileSystem)
Description copied from interface:FileSystemAware
Set the file system in which this shell will be executed.- Specified by:
setFileSystem
in interfaceFileSystemAware
- Parameters:
fileSystem
- the file system
-
destroy
public void destroy(ChannelSession channel) throws java.lang.Exception
Description copied from interface:CommandLifecycle
This method is called by the SSH server to destroy the command because the client has disconnected somehow.- Specified by:
destroy
in interfaceCommandLifecycle
- Overrides:
destroy
in classAbstractCommandSupport
- Parameters:
channel
- TheChannelSession
through which the command has been received- Throws:
java.lang.Exception
- if failed to destroy
-
-