uk.ac.soton.itinnovation.grid.service.utils
Class ScriptInvoker

java.lang.Object
  extended by uk.ac.soton.itinnovation.grid.service.utils.ScriptInvoker

public class ScriptInvoker
extends Object

Title: ScriptInvoker

Description: Invokes command-line scripts

Copyright: Copyright (c) 2004

Company: IT Innovation

Version:
$Id: ScriptInvoker.java 5699 2006-10-16 09:59:04Z tal $
Author:
Mike Jones

Constructor Summary
ScriptInvoker()
           
 
Method Summary
static int runCommand(String[] command, File runDir, StringBuffer stdOutBuf, StringBuffer stdErrBuf)
          Runs the specified command
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScriptInvoker

public ScriptInvoker()
Method Detail

runCommand

public static int runCommand(String[] command,
                             File runDir,
                             StringBuffer stdOutBuf,
                             StringBuffer stdErrBuf)
                      throws GridErrorException
Runs the specified command

Parameters:
command - The command to be run
runDir - The directory to run the command from, if null the current dir is used
stdOutBuf - Buffer to be filled with text from the standard output stream from the command. If this is null, this stream gets dumped to the logfile.
stdErrBuf - Buffer to be filled with text from the standard error stream from the command If this is null, this stream gets dumped to the logfile.
Returns:
Exit code from the command
Throws:
GridErrorException - If there is an error running the command


Copyright © 2001-2008 University of Southampton IT Innovation Centre. All Rights Reserved.