|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.exec.launcher.CommandLauncherImpl
public abstract class CommandLauncherImpl
A command launcher for a particular JVM/OS platform. This class is a general purpose command launcher which can only launch commands in the current working directory.
Constructor Summary | |
---|---|
CommandLauncherImpl()
|
Method Summary | |
---|---|
java.lang.Process |
exec(CommandLine cmd,
java.util.Map env)
Launches the given command in a new process. |
abstract java.lang.Process |
exec(CommandLine cmd,
java.util.Map 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). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CommandLauncherImpl()
Method Detail |
---|
public java.lang.Process exec(CommandLine cmd, java.util.Map env) throws java.io.IOException
CommandLauncher
exec
in interface CommandLauncher
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 directorypublic abstract java.lang.Process exec(CommandLine cmd, java.util.Map env, java.io.File workingDir) throws java.io.IOException
CommandLauncher
exec
in interface CommandLauncher
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 used
java.io.IOException
- if trying to change directorypublic boolean isFailure(int exitValue)
CommandLauncher
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.
isFailure
in interface CommandLauncher
exitValue
- the exit value (return code) to be checked
true
if exitValue
signals a failureCommandLauncher.isFailure(int)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |