er.extensions
Class ERXRuntimeUtilities
java.lang.Object
er.extensions.ERXRuntimeUtilities
- public class ERXRuntimeUtilities
- extends Object
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
log
public static ERXLogger log
- logging support
ERXRuntimeUtilities
public ERXRuntimeUtilities()
executeCommandLineCommandsWithEnvVarsInWorkingDir
public static final ERXRuntimeUtilities.Result[] executeCommandLineCommandsWithEnvVarsInWorkingDir(String[] commands,
String[] envp,
File dir)
throws IOException
- Excecutes the specified command line commands. If envp is not null the environment variables are set
before executing the command.
- Parameters:
commands
- the commands to execute like "ls -la" or "cp /tmp/file1 /tmp/file2" or "open /Applications/*.app"envp
- a String
array which represents the environment variables like
String[] envp = new String[]{"PATH=/usr/bin:/bin", "CVS_RSH=ssh"}
, can be nulldir
- a File
object representing the working directory, can be null
- Returns:
- the results from the processes that were executed
- Throws:
IOException
- if something went wrong
executeCommandLineCommandWithArgumentsWithEnvVarsInWorkingDir
public static final ERXRuntimeUtilities.Result executeCommandLineCommandWithArgumentsWithEnvVarsInWorkingDir(String[] command,
String[] envp,
File dir)
throws IOException
- Excecutes the specified command line commands. If envp is not null the environment variables are set
before executing the command.
- Parameters:
envp
- a String
array which represents the environment variables like
String[] envp = new String[]{"PATH=/usr/bin:/bin", "CVS_RSH=ssh"}
, can be nulldir
- a File
object representing the working directory, can be null
- Returns:
- the results from the processes that were executed
- Throws:
IOException
- if something went wrong
executeCommandLineCommandWithEnvVarsInWorkingDir
public static final ERXRuntimeUtilities.Result executeCommandLineCommandWithEnvVarsInWorkingDir(String command,
String[] envp,
File dir)
throws IOException
- Excecutes the specified command line command. If envp is not null the environment variables are set
before executing the command.
- Parameters:
command
- the command to execute like "ls -la" or "cp /tmp/file1 /tmp/file2" or "open /Applications/*.app"envp
- a String
array which represents the environment variables like
String[] envp = new String[]{"PATH=/usr/bin:/bin", "CVS_RSH=ssh"}
, can be nulldir
- a File
object representing the working directory, can be null
- Returns:
- the result from the process that was executed
- Throws:
IOException
- if something went wrong
freeProcessResources
public static void freeProcessResources(Process p)
- Frees all of a resources associated with a given
process and then destroys it.
- Parameters:
p
- process to destroy
escapePath
public static String escapePath(String path)
Copyright © 2002 – 2004 Project Wonder.