public abstract class

Process

extends Object
java.lang.Object
   ↳ java.lang.Process

Class Overview

Represents an external process. Enables writing to, reading from, destroying, and waiting for the external process, as well as querying its exit value.

Summary

Public Constructors
Process()
Public Methods
abstract void destroy()
Terminates this process and closes any associated streams.
abstract int exitValue()
Returns the exit value of the native process represented by this object.
abstract InputStream getErrorStream()
Returns an input stream that is connected to the error stream (stderr) of the native process represented by this object.
abstract InputStream getInputStream()
Returns an input stream that is connected to the standard output stream (stdout) of the native process represented by this object.
abstract OutputStream getOutputStream()
Returns an output stream that is connected to the standard input stream (stdin) of the native process represented by this object.
abstract int waitFor()
Causes the calling thread to wait for the native process associated with this object to finish executing.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public Process ()

Public Methods

public abstract void destroy ()

Terminates this process and closes any associated streams.

public abstract int exitValue ()

Returns the exit value of the native process represented by this object. It is available only when the native process has terminated.

Returns
  • the exit value of this process.
Throws
IllegalThreadStateException if this process has not terminated.

public abstract InputStream getErrorStream ()

Returns an input stream that is connected to the error stream (stderr) of the native process represented by this object.

Returns
  • the input stream to read from the error stream associated with the native process.

public abstract InputStream getInputStream ()

Returns an input stream that is connected to the standard output stream (stdout) of the native process represented by this object.

Returns
  • the input stream to read from the output stream associated with the native process.

public abstract OutputStream getOutputStream ()

Returns an output stream that is connected to the standard input stream (stdin) of the native process represented by this object.

Returns
  • the output stream to write to the input stream associated with the native process.

public abstract int waitFor ()

Causes the calling thread to wait for the native process associated with this object to finish executing.

Returns
  • the exit value of the native process being waited on.
Throws
InterruptedException if the calling thread is interrupted.