org.schmant.task.template.process
Class ExtProcessSupport

java.lang.Object
  extended by org.schmant.task.template.process.ExtProcessSupport

public final class ExtProcessSupport
extends Object

Class with static support methods for running external programs. The methods defined in this class are meant to be used by classes that run external programs but cannot inherit AbstractExtProcessTask.

Since:
0.5
Author:
Karl Gustafsson

Field Summary
static ProcessOutputStrategy DEFAULT_STDERR_STRATEGY
           
static ProcessOutputStrategy DEFAULT_STDOUT_STRATEGY
           
 
Method Summary
static ProcessResult execAndWait(ProcessSettings ps, ExtProcessConfigured c)
          Run the program and return the result.
static ProcessSettings getProcessSettings(ExtProcessConfigured c)
          Get the settings for the external program.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_STDOUT_STRATEGY

public static final ProcessOutputStrategy DEFAULT_STDOUT_STRATEGY

DEFAULT_STDERR_STRATEGY

public static final ProcessOutputStrategy DEFAULT_STDERR_STRATEGY
Method Detail

getProcessSettings

public static ProcessSettings getProcessSettings(ExtProcessConfigured c)
Get the settings for the external program.

Parameters:
c - A configuration object.
Returns:
The configuration for the program.

execAndWait

public static ProcessResult execAndWait(ProcessSettings ps,
                                        ExtProcessConfigured c)
                                 throws InterruptedException
Run the program and return the result.

Parameters:
ps - The program settings
c - The program configurable.
Returns:
The program result.
Throws:
InterruptedException - If the thread was interrupted.