source: AE/installer2/src/net/oni2/aeinstaller/backend/QuickAppExecution.java@ 601

Last change on this file since 601 was 600, checked in by alloc, 12 years ago
File size: 965 bytes
Line 
1package net.oni2.aeinstaller.backend;
2
3import java.io.BufferedReader;
4import java.io.IOException;
5import java.io.InputStream;
6import java.io.InputStreamReader;
7import java.util.List;
8import java.util.Vector;
9
10/**
11 * @author Christian Illy
12 */
13public 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}
Note: See TracBrowser for help on using the repository browser.