Class CommandLine


  • public class CommandLine
    extends java.lang.Object
    • Constructor Detail

      • CommandLine

        public CommandLine​(java.lang.String executable,
                           java.lang.String... args)
      • CommandLine

        public CommandLine​(java.lang.String[] cmdarray)
    • Method Detail

      • setEnvironmentVariables

        public void setEnvironmentVariables​(java.util.Map<java.lang.String,​java.lang.String> environment)
        Adds the specified environment variables.
        Parameters:
        environment - the variables to add
        Throws:
        java.lang.IllegalArgumentException - if any value given is null (unsupported)
      • setEnvironmentVariable

        public void setEnvironmentVariable​(java.lang.String name,
                                           java.lang.String value)
        Adds the specified environment variable.
        Parameters:
        name - the name of the environment variable
        value - the value of the environment variable
        Throws:
        java.lang.IllegalArgumentException - if the value given is null (unsupported)
      • setDynamicLibraryPath

        public void setDynamicLibraryPath​(java.lang.String newLibraryPath)
      • updateDynamicLibraryPath

        public void updateDynamicLibraryPath​(java.lang.String extraPath)
      • getLibraryPathPropertyName

        public static java.lang.String getLibraryPathPropertyName()
        Returns:
        The platform specific env property name which contains the library path.
      • executeAsync

        public void executeAsync()
      • execute

        public void execute()
      • waitFor

        public void waitFor()
      • waitFor

        public void waitFor​(long timeout)
      • isSuccessful

        public boolean isSuccessful()
      • getExitCode

        public int getExitCode()
      • getStdOut

        public java.lang.String getStdOut()
      • destroy

        public int destroy()
        Destroy the current command.
        Returns:
        The exit code of the command.
      • isRunning

        public boolean isRunning()
        Check whether the current command is still executing.
        Returns:
        true if the current command is still executing, false otherwise
      • setInput

        public void setInput​(java.lang.String allInput)
      • setWorkingDirectory

        public void setWorkingDirectory​(java.lang.String workingDirectory)
      • toString

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

        public void copyOutputTo​(java.io.OutputStream out)
      • checkForError

        public void checkForError()