Class ShellCommand

java.lang.Object
org.variantsync.diffdetective.shell.ShellCommand
Direct Known Subclasses:
PythonCommand, SimpleCommand

public abstract class ShellCommand extends Object
Representation of an executable command. An executable command is a path to an executable file with arguments which are provided to that executable on execution.
Author:
Alexander Schultheiß
  • Constructor Details

    • ShellCommand

      public ShellCommand()
  • Method Details

    • parts

      public abstract String[] parts()
      Returns the String parts that define and configure the command execution. The first array entry is a path to an executable file. The others are arguments for that executable.

      Example: ["echo", "Hello World"]

      Returns:
      the parts of the shell command.
    • interpretResult

      public List<String> interpretResult(int resultCode, List<String> output) throws ShellException
      Interpret the result/exit code returned from a shell command. An ShellException is thrown if the result code is an error.
      Parameters:
      resultCode - the code that is to be parsed
      output - the output of the shell command
      Returns:
      the output of the shell command
      Throws:
      ShellException - if resultCode is an error
    • toString

      public String toString()
      Overrides:
      toString in class Object