ariba.util.io
Class Exec
java.lang.Object
ariba.util.io.Exec
public final class Exec
- extends java.lang.Object
Runtime.exec made simple
Method Summary |
static int |
exec(java.lang.String[] cmdarray,
java.lang.String[] envp,
int timeout,
java.io.InputStream stdin,
java.io.OutputStream stdout,
java.io.OutputStream stderr)
|
static int |
execWithMasterPassword(java.lang.String[] cmdarray,
java.lang.String[] envp,
int timeout,
java.io.OutputStream stdout,
java.io.OutputStream stderr)
Exec the given command adding the master password info if necessary. |
static void |
main(java.lang.String[] args)
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
exec
public static int exec(java.lang.String[] cmdarray,
java.lang.String[] envp,
int timeout,
java.io.InputStream stdin,
java.io.OutputStream stdout,
java.io.OutputStream stderr)
throws java.io.IOException
- Throws:
java.io.IOException
execWithMasterPassword
public static int execWithMasterPassword(java.lang.String[] cmdarray,
java.lang.String[] envp,
int timeout,
java.io.OutputStream stdout,
java.io.OutputStream stderr)
throws java.io.IOException
- Exec the given command adding the master password info if necessary.
Specifically, the -masterPasswordNoPrompt option is appended to the
cmdarray array, and the master password is fetched and passed to the
stdin of the exec call.
Two limitations:
(1) Original command that requres input data is not supported. In fact,
there is no provision for the caller to provide the stdin
(2) The -masterPasswordNoPrompt is appended at the end of the command line
array, so commands that pipe or redirect output such as {"tableedit", "-script",
"scriptfile", ">", "outfile"} will become {"tableedit", "-script",
"scriptfile", ">", "outfile", "-masterPasswordNoPrompt"), which clearly won't
work.
- Parameters:
cmdarray
- the command to execute, must be non null and not emptyenvp
- the environment to execute, can be mull.timeout
- timeout, a value of timeout will timeout immediately, negative value
means no timeout (wait forever)stdout
- the stdoutstderr
- the stderr
- Returns:
- the status of the exec'ed process. A value of 0 indicates normal termination.
- Throws:
java.io.IOException
- if an I/O error occurs
main
public static void main(java.lang.String[] args)
AribaWeb User Interface Development Framework
Copyright © 2000-2014 Ariba, Inc. All Rights Reserved.