Java exec executeGetStatus(ProcessBuilder pb)

Here you can find the source of executeGetStatus(ProcessBuilder pb)

Description

execute Get Status

License

Apache License

Declaration

public static int executeGetStatus(ProcessBuilder pb) 

Method Source Code

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

import java.io.IOException;

public class Main {
    public static int executeGetStatus(ProcessBuilder pb) {
        Process process;//from  www. j  a  va 2s .  c o  m
        try {
            process = pb.start();
            return processWaitGetStatus(process);
        } catch (IOException e) {
            return -1;
        }
    }

    private static int processWaitGetStatus(Process process) {
        int rc = -1;
        boolean blocked = true;
        while (blocked) {
            try {
                rc = process.waitFor();
                blocked = false;
            } catch (InterruptedException consumed) {
                // just continue to wait
            }
        }
        return rc;
    }
}

Related

  1. executeCommandLineReturnAll( final String[] command)
  2. executeCommandLinux(final String _command)
  3. executeDELETE(String parameters)
  4. executeDotCommand(final File dotFile)
  5. executeGET(DataInputStream sockInp, DataOutputStream sockOutp)
  6. executeIt(String command)
  7. executeLocalCommand(String[] command)
  8. executeLS()
  9. executeMemoryInfoProcess(String... command)