Authored by zhengyouwei

up

... ... @@ -71,40 +71,40 @@ public class CommodUtil {
* @return
*/
public static List<String> exe(String commond) {
try {
Thread.sleep(10000);
} catch (InterruptedException e) {
e.printStackTrace();
}
List<String> list = new ArrayList<>();
list.add(commond);
list.add(commond);
return list;
// Process process;
// List<String> list = new ArrayList<>();
// BufferedReader input = null;
// try {
// process = Runtime.getRuntime().exec(commond);
// input = new BufferedReader(new InputStreamReader(process.getInputStream()));
// String line;
// while ((line = input.readLine()) != null) {
// list.add(line);
// }
// } catch (Exception e) {
// logger.error("process exe failed!", e);
// } finally {
// if (input != null) {
// try {
// input.close();
// } catch (IOException e) {
// logger.error("process exe failed!", e);
// }
// }
// Thread.sleep(10000);
// } catch (InterruptedException e) {
// e.printStackTrace();
// }
// List<String> list = new ArrayList<>();
//
// list.add(commond);
// list.add(commond);
// return list;
Process process;
List<String> list = new ArrayList<>();
BufferedReader input = null;
try {
process = Runtime.getRuntime().exec(commond);
input = new BufferedReader(new InputStreamReader(process.getInputStream()));
String line;
while ((line = input.readLine()) != null) {
list.add(line);
}
} catch (Exception e) {
logger.error("process exe failed!", e);
} finally {
if (input != null) {
try {
input.close();
} catch (IOException e) {
logger.error("process exe failed!", e);
}
}
}
return list;
}
}
... ...