Class ToolRunner


  • public class ToolRunner
    extends java.lang.Object
    Runner for external tools.
    • Constructor Summary

      Constructors 
      Constructor Description
      ToolRunner​(java.io.File tool)
      Creates a runner for a tool.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      ToolRunner arg​(java.lang.Object... args)
      Adds arguments.
      void clear()
      Clears arguments and results.
      int getErrCode()
      Gets the error code.
      java.util.List<java.lang.String> getErrors()
      Gets the standard error output.
      java.lang.String getErrorsAsString()
      Gets the standard error output.
      java.util.List<java.lang.String> getOutput()
      Gets the standard output.
      java.lang.String getOutputAsString()
      Gets the standard output.
      ToolRunner run()
      Runs the tool.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • ToolRunner

        public ToolRunner​(java.io.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​(java.lang.Object... args)
        Adds arguments.
        Parameters:
        args - the arguments
        Returns:
        this runner
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getOutput

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

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

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

        Throws TentackleRuntimeException if run method not invoked yet.

        Returns:
        the error lines, never null
      • getErrorsAsString

        public java.lang.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.