Java exec exec(String args)

Here you can find the source of exec(String args)

Description

exec

License

Apache License

Declaration

static private BufferedReader exec(String args) throws IOException 

Method Source Code


//package com.java2s;
//License from project: Apache License 

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

public class Main {
    static private BufferedReader exec(String args) throws IOException {
        String[] splitArgs = args.split(" ");
        ProcessBuilder builder = new ProcessBuilder(splitArgs);
        Process p = builder.start();
        p.getOutputStream().flush();//  w  w w  . ja  v a 2s.co  m
        p.getOutputStream().close();
        return new BufferedReader(new InputStreamReader(p.getInputStream()));
    }
}

Related

  1. exec(ArrayList args, File path)
  2. exec(File dir, String cmd)
  3. exec(final String cmd, final String[] args, final byte[] in, final File dir)
  4. exec(List cmd, File binDir, File workDir, boolean parseOutput, boolean tossErrorOutput)
  5. exec(String cmd)
  6. exec(String cmd)
  7. exec(String cmd)
  8. exec(String cmd)