Class CommandLineUtils
java.lang.Object
org.apache.maven.shared.utils.cli.CommandLineUtils
- Author:
- Trygve Laugstøl
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
AStreamConsumer
providing consumed lines as aString
. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic int
executeCommandLine
(Commandline cl, InputStream systemIn, StreamConsumer systemOut, StreamConsumer systemErr) static int
executeCommandLine
(Commandline cl, InputStream systemIn, StreamConsumer systemOut, StreamConsumer systemErr, int timeoutInSeconds) static int
executeCommandLine
(Commandline cl, InputStream systemIn, StreamConsumer systemOut, StreamConsumer systemErr, int timeoutInSeconds, Runnable runAfterProcessTermination) static int
executeCommandLine
(Commandline cl, InputStream systemIn, StreamConsumer systemOut, StreamConsumer systemErr, int timeoutInSeconds, Runnable runAfterProcessTermination, Charset streamCharset) static int
executeCommandLine
(Commandline cl, StreamConsumer systemOut, StreamConsumer systemErr) static int
executeCommandLine
(Commandline cl, StreamConsumer systemOut, StreamConsumer systemErr, int timeoutInSeconds) static CommandLineCallable
executeCommandLineAsCallable
(Commandline cl, InputStream systemIn, StreamConsumer systemOut, StreamConsumer systemErr, int timeoutInSeconds, Runnable runAfterProcessTermination) Immediately forks a process, returns a callable that will block until process is complete.static CommandLineCallable
executeCommandLineAsCallable
(Commandline cl, InputStream systemIn, StreamConsumer systemOut, StreamConsumer systemErr, int timeoutInSeconds, Runnable runAfterProcessTermination, Charset streamCharset) Immediately forks a process, returns a callable that will block until process is complete.static Properties
Deprecated.use System#getenv()static Properties
getSystemEnvVars
(boolean caseSensitive) Deprecated.use System#getenv()static String
static String[]
translateCommandline
(String toProcess)
-
Constructor Details
-
CommandLineUtils
public CommandLineUtils()
-
-
Method Details
-
getSystemEnvVars
Deprecated.use System#getenv()Gets the shell environment variables for this process. Note that the returned mapping from variable names to values will always be case-sensitive regardless of the platform, i.e.getSystemEnvVars().get("path")
andgetSystemEnvVars().get("PATH")
will in general return different values. However, on platforms with case-insensitive environment variables like Windows, all variable names will be normalized to upper case.- Returns:
- The shell environment variables, can be empty but never
null
.
-
getSystemEnvVars
Deprecated.use System#getenv()Return the shell environment variables. IfcaseSensitive == true
, then envar keys will all be upper-case.- Parameters:
caseSensitive
- Whether environment variable keys should be treated case-sensitively.- Returns:
- Properties object of (possibly modified) envar keys mapped to their values.
-
translateCommandline
- Parameters:
toProcess
- The command line to translate.- Returns:
- The array of translated parts.
- Throws:
CommandLineException
- in case of unbalanced quotes.
-
toString
- Parameters:
line
- the lines- Returns:
- the concatenated lines, quoted and escaped, separated by spaces