File tree 1 file changed +20
-19
lines changed
1 file changed +20
-19
lines changed Original file line number Diff line number Diff line change @@ -60,26 +60,27 @@ public String getMenuTitle() {
60
60
}
61
61
62
62
private int listenOnProcess (String [] arguments ){
63
- try {
64
- final Process p = ProcessUtils .exec (arguments );
65
- Thread thread = new Thread () {
66
- public void run () {
67
- try {
68
- String line ;
69
- BufferedReader input = new BufferedReader (new InputStreamReader (p .getInputStream ()));
70
- while ((line = input .readLine ()) != null ) System .out .println (line );
71
- input .close ();
72
- } catch (Exception e ){}
73
- }
74
- };
75
- thread .start ();
76
- int res = p .waitFor ();
77
- thread .join ();
78
- return res ;
79
- } catch (Exception e ){
80
- return -1 ;
63
+ try {
64
+ final Process p = ProcessUtils .exec (arguments );
65
+ Thread thread = new Thread () {
66
+ public void run () {
67
+ try {
68
+ InputStreamReader reader = new InputStreamReader (p .getInputStream ());
69
+ int c ;
70
+ while ((c = reader .read ()) != -1 )
71
+ System .out .print ((char ) c );
72
+ reader .close ();
73
+ } catch (Exception e ){}
74
+ }
75
+ };
76
+ thread .start ();
77
+ int res = p .waitFor ();
78
+ thread .join ();
79
+ return res ;
80
+ } catch (Exception e ){
81
+ return -1 ;
82
+ }
81
83
}
82
- }
83
84
84
85
private void sysExec (final String [] arguments ){
85
86
Thread thread = new Thread () {
You can’t perform that action at this time.
0 commit comments