eu.lindenbaum.maven.util
Class ErlUtils

java.lang.Object
  extended by eu.lindenbaum.maven.util.ErlUtils

public final class ErlUtils
extends Object

Containing utilities related to erlang code execution.

Author:
Tobias Schlager

Constructor Summary
ErlUtils()
           
 
Method Summary
static String eval(org.apache.maven.plugin.logging.Log log, String expression)
          Evaluate an erlang expression and return the result.
static String eval(org.apache.maven.plugin.logging.Log log, String expression, List<File> libPaths)
          Evaluate an erlang expression and return the result.
static String eval(org.apache.maven.plugin.logging.Log log, String expression, List<File> libPaths, File workingDir)
          Evaluate an erlang expression and return the result.
static String exec(List<String> commands, org.apache.maven.plugin.logging.Log log, File workingDir, Observer observer)
          Executes the given command array in the given working directory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ErlUtils

public ErlUtils()
Method Detail

eval

public static String eval(org.apache.maven.plugin.logging.Log log,
                          String expression)
                   throws org.apache.maven.plugin.MojoExecutionException,
                          org.apache.maven.plugin.MojoFailureException
Evaluate an erlang expression and return the result.

Parameters:
log - logger.
expression - the expression to evaluate.
Returns:
the output of the erl interpreter.
Throws:
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException

eval

public static String eval(org.apache.maven.plugin.logging.Log log,
                          String expression,
                          List<File> libPaths)
                   throws org.apache.maven.plugin.MojoExecutionException,
                          org.apache.maven.plugin.MojoFailureException
Evaluate an erlang expression and return the result.

Parameters:
log - logger
expression - the expression to evaluate.
libPaths - list of paths to add to the path, maybe null
Returns:
the output of the erl interpreter.
Throws:
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException

eval

public static String eval(org.apache.maven.plugin.logging.Log log,
                          String expression,
                          List<File> libPaths,
                          File workingDir)
                   throws org.apache.maven.plugin.MojoExecutionException,
                          org.apache.maven.plugin.MojoFailureException
Evaluate an erlang expression and return the result.

Parameters:
log - logger
expression - the expression to evaluate.
libPaths - list of paths to add to the path, maybe null
workingDir - the working directory for the spawned process, maybe null
Returns:
the output of the erl interpreter.
Throws:
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException

exec

public static String exec(List<String> commands,
                          org.apache.maven.plugin.logging.Log log,
                          File workingDir,
                          Observer observer)
                   throws org.apache.maven.plugin.MojoExecutionException,
                          org.apache.maven.plugin.MojoFailureException
Executes the given command array in the given working directory. After process completion the given Observer is notfied to process the result.

Parameters:
commands - to execute
log - used to log errors
workingDir - the working directory for the spawned process, maybe null
observer - to be notified on process completion
Throws:
org.apache.maven.plugin.MojoExecutionException
org.apache.maven.plugin.MojoFailureException


Copyright © 2010 Lindenbaum GmbH. All Rights Reserved.