|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.codehaus.plexus.util.cli.CommandLineUtils
Nested Class Summary | |
static class |
CommandLineUtils.StringStreamConsumer
|
Constructor Summary | |
CommandLineUtils()
|
Method Summary | |
static int |
executeCommandLine(Commandline cl,
java.io.InputStream systemIn,
StreamConsumer systemOut,
StreamConsumer systemErr)
|
static int |
executeCommandLine(Commandline cl,
java.io.InputStream systemIn,
StreamConsumer systemOut,
StreamConsumer systemErr,
int timeoutInSeconds)
|
static int |
executeCommandLine(Commandline cl,
StreamConsumer systemOut,
StreamConsumer systemErr)
|
static int |
executeCommandLine(Commandline cl,
StreamConsumer systemOut,
StreamConsumer systemErr,
int timeoutInSeconds)
|
static java.util.Properties |
getSystemEnvVars()
|
static java.util.Properties |
getSystemEnvVars(boolean caseSensitive)
Return the shell environment variables. |
static boolean |
isAlive(long pid)
|
static boolean |
isAlive(java.lang.Process p)
|
static void |
killProcess(long pid)
Kill a process launched by executeCommandLine methods Doesn't work correctly on windows, only the cmd process will be destroy but not the sub process (Bug ID 4770092) |
static java.lang.String |
quote(java.lang.String argument)
Put quotes around the given String if necessary. |
static java.lang.String |
quote(java.lang.String argument,
boolean wrapExistingQuotes)
Put quotes around the given String if necessary. |
static java.lang.String |
quote(java.lang.String argument,
boolean escapeSingleQuotes,
boolean escapeDoubleQuotes,
boolean wrapExistingQuotes)
|
static java.lang.String |
toString(java.lang.String[] line)
|
static java.lang.String[] |
translateCommandline(java.lang.String toProcess)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public CommandLineUtils()
Method Detail |
public static int executeCommandLine(Commandline cl, StreamConsumer systemOut, StreamConsumer systemErr) throws CommandLineException
CommandLineException
public static int executeCommandLine(Commandline cl, StreamConsumer systemOut, StreamConsumer systemErr, int timeoutInSeconds) throws CommandLineException
CommandLineException
public static int executeCommandLine(Commandline cl, java.io.InputStream systemIn, StreamConsumer systemOut, StreamConsumer systemErr) throws CommandLineException
CommandLineException
public static int executeCommandLine(Commandline cl, java.io.InputStream systemIn, StreamConsumer systemOut, StreamConsumer systemErr, int timeoutInSeconds) throws CommandLineException
CommandLineException
public static java.util.Properties getSystemEnvVars() throws java.io.IOException
java.io.IOException
public static java.util.Properties getSystemEnvVars(boolean caseSensitive) throws java.io.IOException
caseSensitive == true
, then envar
keys will all be upper-case.
caseSensitive
- Whether environment variable keys should be treated case-sensitively.
java.io.IOException
public static void killProcess(long pid)
pid
- The pid of command return by Commandline.getPid()public static boolean isAlive(long pid)
public static boolean isAlive(java.lang.Process p)
public static java.lang.String[] translateCommandline(java.lang.String toProcess) throws java.lang.Exception
java.lang.Exception
public static java.lang.String quote(java.lang.String argument) throws CommandLineException
Put quotes around the given String if necessary.
If the argument doesn't include spaces or quotes, return it as is. If it contains double quotes, use single quotes - else surround the argument by double quotes.
CommandLineException
- if the argument contains both, single
and double quotes.public static java.lang.String quote(java.lang.String argument, boolean wrapExistingQuotes) throws CommandLineException
Put quotes around the given String if necessary.
If the argument doesn't include spaces or quotes, return it as is. If it contains double quotes, use single quotes - else surround the argument by double quotes.
CommandLineException
- if the argument contains both, single
and double quotes.public static java.lang.String quote(java.lang.String argument, boolean escapeSingleQuotes, boolean escapeDoubleQuotes, boolean wrapExistingQuotes) throws CommandLineException
CommandLineException
public static java.lang.String toString(java.lang.String[] line)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |