public class SystemHelper
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
PATH_SEPARATOR |
| Constructor and Description |
|---|
SystemHelper() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String[] |
addEnv(java.lang.String[] pEnv,
java.lang.String pName,
java.lang.String pValue,
java.lang.String pSeparator)
Add an environment variable to an array of existing variables.
|
static java.lang.String[] |
addPathEnv(java.lang.String[] pEnv,
java.lang.String pName,
java.lang.String[] pValue)
Add an environment variable to an array of existing variables.
|
static java.io.File |
getFile(org.eclipse.core.resources.IResource pRes)
Get a normal Java File from an Eclipse IResource.
|
static java.io.File |
getFile(IUnoidlProject pPrj)
Get a normal Java File from an
IUnoidlProject. |
static java.lang.String[] |
getSystemEnvironement() |
static java.lang.Process |
runTool(java.lang.String pShellCommand,
java.lang.String[] pEnv,
java.io.File pExecDir)
Run a shell command with a given environment and an optional execution directory.
|
static java.lang.Process |
runToolWithSysEnv(java.lang.String pShellCommand,
java.io.File pExecDir)
Run a shell command with the system environment and an optional execution directory.
|
public static java.io.File getFile(org.eclipse.core.resources.IResource pRes)
pRes - the IResource to convertpublic static java.io.File getFile(IUnoidlProject pPrj)
IUnoidlProject.pPrj - IUnoidlProject to convertpublic static java.lang.String[] addPathEnv(java.lang.String[] pEnv,
java.lang.String pName,
java.lang.String[] pValue)
pEnv - the array of existing environment variables where to add the new variablepName - the name of the variable to addpValue - the value of the variable to addpublic static java.lang.String[] addEnv(java.lang.String[] pEnv,
java.lang.String pName,
java.lang.String pValue,
java.lang.String pSeparator)
pEnv - the array of existing environment variables where to add the new variablepName - the name of the variable to addpValue - the value of the variable to addpSeparator - the separator to use if there is already a variable with the same name. If null, the old
variable will be replacedpublic static java.lang.String[] getSystemEnvironement()
public static java.lang.Process runToolWithSysEnv(java.lang.String pShellCommand,
java.io.File pExecDir)
throws java.io.IOException
pShellCommand - the command to runpExecDir - the execution directory or null if nonejava.io.IOException - if anything wrong happens during the command launchpublic static java.lang.Process runTool(java.lang.String pShellCommand,
java.lang.String[] pEnv,
java.io.File pExecDir)
throws java.io.IOException
pShellCommand - the command to runpEnv - the environment variablespExecDir - the execution directory or null if nonejava.io.IOException - if anything wrong happens during the command launch