Class OsCommandExecutor

java.lang.Object
com.michelin.cert.redscan.utils.system.OsCommandExecutor

public class OsCommandExecutor extends Object
Os Command Executor.
Author:
Maxime ESCOURBIAC
  • Constructor Details

    • OsCommandExecutor

      public OsCommandExecutor()
  • Method Details

    • execute

      public StreamGobbler execute(String command)
      Execute securely a process.
      Parameters:
      command - Command to execute.
      Returns:
      The StreamGobbler of the run.
    • execute

      public StreamGobbler execute(String command, boolean flushInput)
      Execute securely a process.
      Parameters:
      command - Command to execute.
      flushInput - True if the stream read by the application need to be closed for the execution.
      Returns:
      The StreamGobbler of the run.
    • execute

      public StreamGobbler execute(String command, File executionDir)
      Execute securely a process.
      Parameters:
      command - Command to execute.
      executionDir - Execution directory.
      Returns:
      The StreamGobbler of the run.
    • execute

      public StreamGobbler execute(String command, File executionDir, boolean flushInput)
      Execute securely a process.
      Parameters:
      command - Command to execute.
      executionDir - Execution directory.
      flushInput - True if the stream read by the application need to be closed for the execution.
      Returns:
      The StreamGobbler of the run.