org.objectledge.external
Class ExecutionResult

java.lang.Object
  extended by org.objectledge.external.ExecutionResult

public class ExecutionResult
extends Object

Represents the result of script execution.

Version:
$Id: ExecutionResult.java,v 1.1 2006/03/24 14:27:37 rafal Exp $
Author:
RafaƂ Krzewski

Field Summary
private static int BUFFER_SIZE
           
private  byte[] error
           
private  int exitValue
           
private  byte[] output
           
 
Constructor Summary
ExecutionResult(int exitValue)
          Creates a new ExecutionResult instance.
ExecutionResult(int exitValue, byte[] output, byte[] error)
          Creates a new ExecutionResult instance.
 
Method Summary
 String getError()
          Returns the data captured from process error stream as an UTF-8 string.
 String getError(String charset)
          Returns the data captured from process error stream as a string.
 byte[] getErrorBytes()
          Returns the data captured from process error stream as bytes.
 int getExitValue()
          Returns the process exit value.
 String getOutput()
          Returns the data captured from process output stream as an UTF-8 string.
 String getOutput(String charset)
          Returns the data captured from process output stream as a string.
 byte[] getOutputBytes()
          Returns the data captured from process output stream as bytes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BUFFER_SIZE

private static final int BUFFER_SIZE
See Also:
Constant Field Values

exitValue

private final int exitValue

output

private final byte[] output

error

private final byte[] error
Constructor Detail

ExecutionResult

public ExecutionResult(int exitValue,
                       byte[] output,
                       byte[] error)
Creates a new ExecutionResult instance.

Parameters:
exitValue - the exit value of the process.
captured - output stream the process, or null if not available.
captured - error stream the process, or null if not available.

ExecutionResult

public ExecutionResult(int exitValue)
Creates a new ExecutionResult instance.

Parameters:
exitValue - process exit value.
Method Detail

getExitValue

public int getExitValue()
Returns the process exit value.

Returns:
the process exit value.

getOutputBytes

public byte[] getOutputBytes()
Returns the data captured from process output stream as bytes.

Returns:
the data captured from process output stream as bytes, or null if not available.

getOutput

public String getOutput(String charset)
                 throws UnsupportedEncodingException
Returns the data captured from process output stream as a string.

Parameters:
charset - output stream encoding.
Returns:
the data captured from process output stream as a string, or null if not available.
Throws:
UnsupportedEncodingException - if the encoding is not supported by the VM.

getOutput

public String getOutput()
Returns the data captured from process output stream as an UTF-8 string.

Returns:
the data captured from process output stream as an UTF-8 string, or null if not available.

getErrorBytes

public byte[] getErrorBytes()
Returns the data captured from process error stream as bytes.

Returns:
the data captured from process error stream as bytes, or null if not available.

getError

public String getError(String charset)
                throws UnsupportedEncodingException
Returns the data captured from process error stream as a string.

Parameters:
charset - output stream encoding.
Returns:
the data captured from process error stream as a string, or null if not available.
Throws:
UnsupportedEncodingException - if the encoding is not supported by the VM.

getError

public String getError()
Returns the data captured from process error stream as an UTF-8 string.

Returns:
the data captured from process error stream as an UTF-8 string, or null if not available.


Copyright © 2003-2006 objectledge.org. All Rights Reserved.