|
@@ -21,7 +21,6 @@ public class SimpleShell {
|
21
|
21
|
BufferedReader console = new BufferedReader
|
22
|
22
|
(new InputStreamReader(System.in));
|
23
|
23
|
|
24
|
|
- ObjectMapper mapper = new ObjectMapper();
|
25
|
24
|
ProcessBuilder pb = new ProcessBuilder();
|
26
|
25
|
List<String> history = new ArrayList<String>();
|
27
|
26
|
int index = 0;
|
|
@@ -90,20 +89,20 @@ public class SimpleShell {
|
90
|
89
|
}
|
91
|
90
|
|
92
|
91
|
// wait, wait, what curiousness is this?
|
93
|
|
- Process process = pb.start();
|
94
|
|
-
|
95
|
|
- //obtain the input stream
|
96
|
|
- InputStream is = process.getInputStream();
|
97
|
|
- InputStreamReader isr = new InputStreamReader(is);
|
98
|
|
- BufferedReader br = new BufferedReader(isr);
|
99
|
|
-
|
100
|
|
- //read output of the process
|
101
|
|
- String line;
|
102
|
|
- while ((line = br.readLine()) != null)
|
103
|
|
- System.out.println(line);
|
104
|
|
- br.close();
|
105
|
|
-
|
106
|
|
-
|
|
92
|
+// Process process = pb.start();
|
|
93
|
+//
|
|
94
|
+// //obtain the input stream
|
|
95
|
+// InputStream is = process.getInputStream();
|
|
96
|
+// InputStreamReader isr = new InputStreamReader(is);
|
|
97
|
+// BufferedReader br = new BufferedReader(isr);
|
|
98
|
+//
|
|
99
|
+// //read output of the process
|
|
100
|
+// String line;
|
|
101
|
+// while ((line = br.readLine()) != null)
|
|
102
|
+// System.out.println(line);
|
|
103
|
+// br.close();
|
|
104
|
+ ThreadCall threadCall = new ThreadCall();
|
|
105
|
+ threadCall.run(pb);
|
107
|
106
|
}
|
108
|
107
|
|
109
|
108
|
//catch ioexception, output appropriate message, resume waiting for input
|
|
@@ -121,7 +120,6 @@ public class SimpleShell {
|
121
|
120
|
|
122
|
121
|
}
|
123
|
122
|
|
124
|
|
-
|
125
|
123
|
}
|
126
|
124
|
|
127
|
125
|
}
|