Package org.apache.sshd.server.command
Interface CommandFactory
-
- All Known Implementing Classes:
AbstractDelegatingCommandFactory
,ProcessShellCommandFactory
,ScpCommandFactory
,UnknownCommandFactory
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface CommandFactory
Commands are executed on the server side when an "exec" channel is requested by the SSH client.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description Command
createCommand(ChannelSession channel, java.lang.String command)
Create a command with the given name.static java.util.List<java.lang.String>
split(java.lang.String command)
-
-
-
Method Detail
-
createCommand
Command createCommand(ChannelSession channel, java.lang.String command) throws java.io.IOException
Create a command with the given name. If the command is not known, a dummy command should be returned to allow the display output to be sent back to the client.- Parameters:
channel
- TheChannelSession
through which the command has been receivedcommand
- The command that will be run- Returns:
- a non
null
Command
instance - Throws:
java.io.IOException
- if failed to create the instance
-
split
static java.util.List<java.lang.String> split(java.lang.String command)
- Parameters:
command
- The raw command - ignored ifnull
/empty- Returns:
- The parsed command elements while stripping quoted arguments
-
-