getSystemEnvVars
public static Properties getSystemEnvVars()
throws IOException
getSystemEnvVars
public static Properties getSystemEnvVars(boolean caseSensitive)
throws IOException
Return the shell environment variables. If caseSensitive == true
, then envar
keys will all be upper-case.
caseSensitive
- Whether environment variable keys should be treated case-sensitively.
- Properties object of (possibly modified) envar keys mapped to their values.
isAlive
public static boolean isAlive(Process p)
isAlive
public static boolean isAlive(long pid)
killProcess
public 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)
pid
- The pid of command return by Commandline.getPid()
quote
public static String quote(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.
quote
public static String quote(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.
quote
public static String quote(String argument,
boolean escapeSingleQuotes,
boolean escapeDoubleQuotes,
boolean wrapExistingQuotes)
throws CommandLineException
toString
public static String toString(String[] line)
translateCommandline
public static String[] translateCommandline(String toProcess)
throws Exception