org.springframework.util.exec
Class Background
java.lang.Object
org.springframework.util.exec.Background
public class Background
- extends Object
Class to execute processes in the background. These processes
will not exit once the controlling Java process exits.
Method Summary |
static void |
exec(String[] cmd)
Execute the command (and its args, ala Runtime.exec), sending the
output && error streams to the void. |
static void |
exec(String[] cmd,
File outFile,
boolean appendOut,
File errFile,
boolean appendErr)
Execute a command (and its args, ala Runtime.exec) |
static void |
main(String[] args)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Background
public Background()
exec
public static void exec(String[] cmd)
throws IOException
- Execute the command (and its args, ala Runtime.exec), sending the
output && error streams to the void.
- Throws:
IOException
exec
public static void exec(String[] cmd,
File outFile,
boolean appendOut,
File errFile,
boolean appendErr)
throws IOException
- Execute a command (and its args, ala Runtime.exec)
- Parameters:
outFile
- File to send standard out from the process toappendOut
- If true, append the file with standard out,
else truncate or create a new fileerrFile
- File to send standard err from the process toappendErr
- If true, append the file with standard error,
else truncate or create a new file
- Throws:
IOException
main
public static void main(String[] args)
throws Exception
- Throws:
Exception
Copyright © 2011. All Rights Reserved.