public interface CommandLauncher
Modifier and Type | Method and Description |
---|---|
java.lang.Process |
exec(CommandLine cmd,
java.util.Map<java.lang.String,java.lang.String> env)
Launches the given command in a new process.
|
java.lang.Process |
exec(CommandLine cmd,
java.util.Map<java.lang.String,java.lang.String> env,
java.io.File workingDir)
Launches the given command in a new process, in the given working
directory.
|
boolean |
isFailure(int exitValue)
Checks whether
exitValue signals a failure on the current
system (OS specific). |
java.lang.Process exec(CommandLine cmd, java.util.Map<java.lang.String,java.lang.String> env) throws java.io.IOException
cmd
- The command to executeenv
- The environment for the new process. If null, the environment
of the current process is used.java.io.IOException
- if attempting to run a command in a specific directoryjava.lang.Process exec(CommandLine cmd, java.util.Map<java.lang.String,java.lang.String> env, java.io.File workingDir) throws java.io.IOException
cmd
- The command to executeenv
- The environment for the new process. If null, the environment
of the current process is used.workingDir
- The directory to start the command in. If null, the current
directory is usedjava.io.IOException
- if trying to change directoryboolean isFailure(int exitValue)
exitValue
signals a failure on the current
system (OS specific).
Note that this method relies on the conventions of the OS, it will return false results if the application you are running doesn't follow these conventions. One notable exception is the Java VM provided by HP for OpenVMS - it will return 0 if successful (like on any other platform), but this signals a failure on OpenVMS. So if you execute a new Java VM on OpenVMS, you cannot trust this method.
exitValue
- the exit value (return code) to be checkedtrue
if exitValue
signals a failure"Copyright © 2010 - 2020 Adobe Systems Incorporated. All Rights Reserved"