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:
Runnable
,FileSystemAware
,SessionContextHolder
,SessionHolder<ServerSession>
,ExecutorServiceCarrier
,Command
,CommandLifecycle
,ServerSessionHolder
,SessionAware
- Direct Known Subclasses:
ScpCommand
,ScpShell
public abstract class AbstractFileSystemCommand
extends AbstractCommandSupport
implements FileSystemAware
Provides a basic useful skeleton for
Command
executions that require file system access-
Field Summary
FieldsFields 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
ConstructorsConstructorDescriptionAbstractFileSystemCommand
(String command, CloseableExecutorService executorService) -
Method Summary
Modifier and TypeMethodDescriptionvoid
destroy
(ChannelSession channel) This method is called by the SSH server to destroy the command because the client has disconnected somehow.void
setFileSystem
(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
-
Field Details
-
fileSystem
-
-
Constructor Details
-
AbstractFileSystemCommand
-
-
Method Details
-
getFileSystem
-
setFileSystem
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
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:
Exception
- if failed to destroy
-