|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.tranche.util.OperatingSystemUtil
public class OperatingSystemUtil
Utility methods for interacting with the operating system.
| Constructor Summary | |
|---|---|
OperatingSystemUtil()
|
|
| Method Summary | |
|---|---|
static java.io.File |
escapeFileName(java.io.File file)
Safely escape file so that name doesn't have illegal characters for any operating system, but using Windows illegal character list to escape characters. |
static java.io.File |
escapeFileNameForWindows(java.io.File file)
Safely escape file so that name doesn't have illegal characters for Windows. |
static int |
executeExternalCommand(java.lang.String command)
Run an external app using Runtime. |
static int |
executeUnixCommandWithOutputRedirect(java.lang.String command,
java.io.File outputFile)
Run an external app using Runtime in Unix, and redirect all output. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public OperatingSystemUtil()
| Method Detail |
|---|
public static int executeExternalCommand(java.lang.String command)
throws java.lang.Exception
Run an external app using Runtime. Should work for Windows XP and other OS.
Note that you should just type the command as if at a prompt. Do not include "cmd \c " prefix for Windows.
command - Just the application name and paramters.
java.lang.Exception
public static int executeUnixCommandWithOutputRedirect(java.lang.String command,
java.io.File outputFile)
throws java.lang.Exception
Run an external app using Runtime in Unix, and redirect all output.
command - Just the application name and paramters.outputFile - The files for all output: standard error and output. All output is appended.
java.lang.Exceptionpublic static java.io.File escapeFileName(java.io.File file)
Safely escape file so that name doesn't have illegal characters for any operating system, but using Windows illegal character list to escape characters.
file -
public static java.io.File escapeFileNameForWindows(java.io.File file)
Safely escape file so that name doesn't have illegal characters for Windows.
file -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||