This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static String executeShellCommand(String command) { | |
StringBuilder stringBuilder = new StringBuilder(); | |
Process process = null; | |
BufferedReader br = null; | |
try { | |
process = Runtime.getRuntime().exec(command); | |
br = new BufferedReader(new InputStreamReader(process.getInputStream())); | |
String line; | |
while ((line = br.readLine()) != null) { | |
stringBuilder.append(line + "\n"); |