ViewVC Help
View File | Revision Log | View Changeset | Root Listing
root/Oni2/AE/installer2/src/net/oni2/aeinstaller/backend/QuickAppExecution.java
Revision: 600
Committed: Wed Jan 9 23:12:01 2013 UTC (12 years, 9 months ago) by alloc
Content type: text/x-java
File size: 965 byte(s)
Log Message:

File Contents

# Content
1 package net.oni2.aeinstaller.backend;
2
3 import java.io.BufferedReader;
4 import java.io.IOException;
5 import java.io.InputStream;
6 import java.io.InputStreamReader;
7 import java.util.List;
8 import java.util.Vector;
9
10 /**
11 * @author Christian Illy
12 */
13 public class QuickAppExecution {
14
15 /**
16 * Execute a short running application
17 *
18 * @param cmdLine
19 * List of command and arguments
20 * @return List of output lines
21 * @throws IOException
22 * Exc
23 */
24 public static Vector<String> execute(List<String> cmdLine)
25 throws IOException {
26 ProcessBuilder pb = new ProcessBuilder(cmdLine);
27 pb.redirectErrorStream(true);
28 Process proc = pb.start();
29
30 InputStream is = proc.getInputStream();
31 InputStreamReader isr = new InputStreamReader(is);
32 BufferedReader br = new BufferedReader(isr);
33
34 String line;
35 Vector<String> lines = new Vector<String>();
36
37 while ((line = br.readLine()) != null) {
38 lines.add(line);
39 }
40 return lines;
41 }
42
43 }