|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.fife.rsta.ac.IOUtil
public class IOUtil
I/O related utility methods. We should think of a better location for these methods.
| Method Summary | |
|---|---|
static String[] |
getEnvironmentSafely(String[] toAdd)
Returns the environment of the current process, with some variables possibly added/overwritten. |
static String |
getEnvSafely(String var)
Returns the value of an environment variable. |
static void |
main(String[] args)
Utility testing method. |
static int |
waitForProcess(Process p,
StringBuffer stdout,
StringBuffer stderr)
Runs a process, possibly capturing its stdout and/or stderr. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static String getEnvSafely(String var)
var - The environment variable.
null if it is not
defined.public static String[] getEnvironmentSafely(String[] toAdd)
toAdd - The environment variables to add/overwrite in the returned
array. This array should have an even length, with even indices
containing variable names and odd indices containing the variable
values.
name=value", so it can be passed directly
into Runtime.exec().
public static int waitForProcess(Process p,
StringBuffer stdout,
StringBuffer stderr)
throws IOException
p - The process.stdout - A buffer in which to put stdout, or null if
you don't want to keep it.stderr - A buffer in which to keep stderr, or null
if you don't want to keep it.
IOException - If an IO error occurs.public static void main(String[] args)
args - Command line arguments.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||