Class SimpleExec

All Implemented Interfaces:
Exec

public class SimpleExec extends SimpleCommandSupport implements Exec
A simple implementation of the Exec interface using a library of SimpleCommands.
  • Constructor Details

    • SimpleExec

      public SimpleExec()
  • Method Details

    • newExecSession

      public ExecSession newExecSession(ExecRequest request) throws IOException
      Description copied from interface: Exec
      Create a new non-interactive console session in which to execute a single command.

      If the request fails, this method should return null and write an error message to request.getErrorStream().

      Specified by:
      newExecSession in interface Exec
      Parameters:
      request - command request
      Returns:
      non-interactive session, or null on failure
      Throws:
      IOException - if an I/O error occurs
    • newExecSession

      public ExecSession newExecSession(ExecRequest request, SimpleCommandSupport.FoundCommand command) throws IOException
      Alternate ssession creator for when the command line is already parsed and a command is already identified.
      Parameters:
      request - session request
      command - command to execute
      Returns:
      new session
      Throws:
      IOException - if an I/O error occurs
      IllegalArgumentException - if any parameter is null