ZetaGrid v1.9

zeta.util
Class ProcessUtils

java.lang.Object
  |
  +--zeta.util.ProcessUtils

public class ProcessUtils
extends java.lang.Object

Provides process utilities.


Constructor Summary
ProcessUtils()
           
 
Method Summary
static int exec(java.lang.String command)
          Executes the specified string command in a separate process and causes the current thread to wait, if necessary, until the process represented by this Process object has terminated.
static int exec(java.lang.String command, java.io.OutputStream out, boolean autoFlush)
          Executes the specified string command in a separate process and causes the current thread to wait, if necessary, until the process represented by this Process object has terminated.
static int exec(java.lang.String command, java.io.OutputStream out, boolean autoFlush, int timeout)
          Executes the specified string command in a separate process and causes the current thread to wait, if necessary, until the process represented by this Process object has terminated.
static int exec(java.lang.String command, java.io.OutputStream out, java.io.OutputStream error, boolean autoFlush, int timeout)
          Executes the specified string command in a separate process and causes the current thread to wait, if necessary, until the process represented by this Process object has terminated.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProcessUtils

public ProcessUtils()
Method Detail

exec

public static int exec(java.lang.String command)
Executes the specified string command in a separate process and causes the current thread to wait, if necessary, until the process represented by this Process object has terminated.

Parameters:
command - a specified system command
Returns:
the exit value of the process. By convention, 0 indicates normal termination and -1 indicates an exception

exec

public static int exec(java.lang.String command,
                       java.io.OutputStream out,
                       boolean autoFlush)
Executes the specified string command in a separate process and causes the current thread to wait, if necessary, until the process represented by this Process object has terminated.

Parameters:
command - a specified system command
out - the standard output of the running process will be transferred to the specified writer
autoFlush - if true, the output buffer will be flushed whenever a byte array is written, one of the println methods is invoked, or a newline character or byte ('\n') is written
Returns:
the exit value of the process. By convention, 0 indicates normal termination and -1 indicates an exception

exec

public static int exec(java.lang.String command,
                       java.io.OutputStream out,
                       boolean autoFlush,
                       int timeout)
Executes the specified string command in a separate process and causes the current thread to wait, if necessary, until the process represented by this Process object has terminated.

Parameters:
command - a specified system command
out - the standard output of the running process will be transferred to the specified writer
autoFlush - if true, the output buffer will be flushed whenever a byte array is written, one of the println methods is invoked, or a newline character or byte ('\n') is written
timeout - the process will be destroyed if the process runs longer than the specified time (in milliseconds)
Returns:
the exit value of the process. By convention, 0 indicates normal termination and -1 indicates an exception

exec

public static int exec(java.lang.String command,
                       java.io.OutputStream out,
                       java.io.OutputStream error,
                       boolean autoFlush,
                       int timeout)
Executes the specified string command in a separate process and causes the current thread to wait, if necessary, until the process represented by this Process object has terminated.

Parameters:
command - a specified system command
out - the standard output of the running process will be transferred to the specified writer
error - the error output of the running process will be transferred to the specified writer
autoFlush - if true, the output buffer will be flushed whenever a byte array is written, one of the println methods is invoked, or a newline character or byte ('\n') is written
timeout - the process will be destroyed if the process runs longer than the specified time (in milliseconds)
Returns:
the exit value of the process. By convention, 0 indicates normal termination and -1 indicates an exception

ZetaGrid v1.9

For further technical papers, see ZetaGrid Technical Documentation.
 
Copyright © 2001,2002 Sebastian Wedeniwski. All Rights Reserved.