Package org.apache.storm.utils

# Class ShellCommandRunnerImpl

java.lang.Object
org.apache.storm.utils.ShellCommandRunnerImpl

All Implemented Interfaces:
  `ShellCommandRunner`

public class ShellCommandRunnerImpl extends Object implements ShellCommandRunner

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ShellCommandRunnerImpl()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `execCommand(String... cmd)`
  Method to execute a shell command.
  `String`
  `execCommand(Map<String,String> env, String... cmd)`
  Method to execute a shell command.
  `String`
  `execCommand(Map<String,String> env, String[] cmd, long timeout)`
  Method to execute a shell command.
  `String`
  `getTokenSeparatorRegex()`
  Token separator regex used to parse Shell tool outputs.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### ShellCommandRunnerImpl

    public ShellCommandRunnerImpl()

- ## Method Details

  - ### execCommand

    public String execCommand(String... cmd) throws IOException
    Description copied from interface: `ShellCommandRunner`
    Method to execute a shell command. Covers most of the simple cases without requiring the user to implement the `ShellUtils` interface.
    Specified by:
      `execCommand` in interface `ShellCommandRunner`
    Parameters:
      `cmd` - shell command to execute.
    Returns:
      the output of the executed command.
    Throws:
      `IOException`

  - ### execCommand

    public String execCommand(Map<String,String> env, String[] cmd, long timeout) throws IOException
    Description copied from interface: `ShellCommandRunner`
    Method to execute a shell command. Covers most of the simple cases without requiring the user to implement the `ShellUtils` interface.
    Specified by:
      `execCommand` in interface `ShellCommandRunner`
    Parameters:
      `env` - the map of environment key=value
      `cmd` - shell command to execute.
      `timeout` - time in milliseconds after which script should be marked timeout
    Returns:
      the output of the executed command.
    Throws:
      `IOException`

  - ### execCommand

    public String execCommand(Map<String,String> env, String... cmd) throws IOException
    Description copied from interface: `ShellCommandRunner`
    Method to execute a shell command. Covers most of the simple cases without requiring the user to implement the `ShellUtils` interface.
    Specified by:
      `execCommand` in interface `ShellCommandRunner`
    Parameters:
      `env` - the map of environment key=value
      `cmd` - shell command to execute.
    Returns:
      the output of the executed command.
    Throws:
      `IOException`

  - ### getTokenSeparatorRegex

    public String getTokenSeparatorRegex()
    Description copied from interface: `ShellCommandRunner`
    Token separator regex used to parse Shell tool outputs.
    Specified by:
      `getTokenSeparatorRegex` in interface `ShellCommandRunner`