Class SystemHelper
java.lang.Object
org.libreoffice.ide.eclipse.core.model.utils.SystemHelper
Helper class for system variables handling.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String[]Add an environment variable to an array of existing variables.static String[]addPathEnv(String[] env, String name, String[] value) Add an environment variable to an array of existing variables.static FilegetFile(org.eclipse.core.resources.IResource res) Get a normal Java File from an Eclipse IResource.static FilegetFile(IUnoidlProject unoPrj) Get a normal Java File from anIUnoidlProject.static String[]static ProcessRun a shell command with a given environment and an optional execution directory.static ProcessrunToolWithSysEnv(String shellCommand, File execDir) Run a shell command with the system environment and an optional execution directory.
-
Field Details
-
PATH_SEPARATOR
-
-
Constructor Details
-
SystemHelper
public SystemHelper()
-
-
Method Details
-
getFile
Get a normal Java File from an Eclipse IResource.- Parameters:
res- the IResource to convert- Returns:
- the equivalent File
-
getFile
Get a normal Java File from anIUnoidlProject.- Parameters:
unoPrj-IUnoidlProjectto convert- Returns:
- the equivalent File
-
addPathEnv
Add an environment variable to an array of existing variables.- Parameters:
env- the array of existing environment variables where to add the new variablename- the name of the variable to addvalue- the value of the variable to add- Returns:
- the completed array
-
addEnv
Add an environment variable to an array of existing variables.- Parameters:
env- the array of existing environment variables where to add the new variablename- the name of the variable to addvalue- the value of the variable to addseparator- the separator to use if there is already a variable with the same name. Ifnull, the old variable will be replaced- Returns:
- the completed array
-
getSystemEnvironement
- Returns:
- the system environment variables
-
runToolWithSysEnv
Run a shell command with the system environment and an optional execution directory.- Parameters:
shellCommand- the command to runexecDir- the execution directory ornullif none- Returns:
- the process for the running command
- Throws:
IOException- if anything wrong happens during the command launch
-
runTool
Run a shell command with a given environment and an optional execution directory.- Parameters:
shellCommand- the command to runenv- the environment variablesexecDir- the execution directory ornullif none- Returns:
- the process for the running command
- Throws:
IOException- if anything wrong happens during the command launch
-