Class ToolRunner


  • public class ToolRunner
    extends Object
    Runner for external tools.
    • Constructor Detail

      • ToolRunner

        public ToolRunner​(File tool)
        Creates a runner for a tool.

        Throws TentackleRuntimeException if tool not found or not executable.

        Parameters:
        tool - the tool
    • Method Detail

      • arg

        public ToolRunner arg​(Object... args)
        Adds arguments.
        Parameters:
        args - the arguments
        Returns:
        this runner
      • getOutput

        public List<String> getOutput()
        Gets the standard output.
        Returns:
        the output lines, never null
      • getOutputAsString

        public String getOutputAsString()
        Gets the standard output.
        Returns:
        the output, never null
      • getErrors

        public List<String> getErrors()
        Gets the standard error output.

        Throws TentackleRuntimeException if run method not invoked yet.

        Returns:
        the error lines, never null
      • getErrorsAsString

        public String getErrorsAsString()
        Gets the standard error output.

        Throws TentackleRuntimeException if run method not invoked yet.

        Returns:
        the errors, never null
      • getErrCode

        public int getErrCode()
        Gets the error code.

        Throws TentackleRuntimeException if run method not invoked yet.

        Returns:
        the error, 0 if ok
      • clear

        public void clear()
        Clears arguments and results.