Java exec executeCmdForReader(String cmd)

Here you can find the source of executeCmdForReader(String cmd)

Description

execute Cmd For Reader

License

Mozilla Public License

Declaration

public static BufferedReader executeCmdForReader(String cmd) throws IOException 

Method Source Code


//package com.java2s;
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
    public static BufferedReader executeCmdForReader(String cmd) throws IOException {
        Process pro = Runtime.getRuntime().exec(cmd);
        BufferedReader bufReader = new BufferedReader(new InputStreamReader(pro.getInputStream(), "UTF-8"));
        return bufReader;
    }//from   w  w  w .  java2 s .c o  m
}

Related

  1. executeApplication(String filePath)
  2. executeBashScriptWithParams(ArrayList script)
  3. executeBatFile(String batFile)
  4. executeCD(String dirPath)
  5. executeCmdCommand(String command)
  6. executeComand(String[] comand)
  7. executeCommand(final ProcessBuilder pb)
  8. executeCommand(final String cmd)
  9. executeCommand(List cmdArray)