Interface Session.Command

All Superinterfaces:
AutoCloseable, Channel, Closeable, ErrorNotifiable, SSHPacketHandler
All Known Implementing Classes:
SessionChannel
Enclosing interface:
Session

public static interface Session.Command extends Channel
Command API.
  • Method Details

    • getErrorStream

      InputStream getErrorStream()
      Returns the command's stderr stream.
    • getExitErrorMessage

      String getExitErrorMessage()
      If the command exit violently with a signal, an error message would have been received and can be retrieved via this method. Otherwise, this method will return null.

      NOTE: Always call Channel.close() first before inspecting the exit error message.

    • getExitSignal

      Signal getExitSignal()
      Returns the signal if the command exit violently, or null if this information was not received.

      NOTE: Always call Channel.close() first before inspecting the exit signal.

    • getExitStatus

      Integer getExitStatus()
      Returns the exit status of the command if it was received, or null if this information was not received.

      NOTE: Always call Channel.close() first before inspecting the exit status.

    • getExitWasCoreDumped

      Boolean getExitWasCoreDumped()
      If the command exit violently with a signal, information about whether a core dump took place would have been received and can be retrieved via this method. Otherwise, this method will return null.
    • signal

      void signal(Signal signal) throws TransportException
      Send a signal to the remote command.
      Parameters:
      signal - the signal
      Throws:
      TransportException - if error sending the signal