uk.ac.soton.itinnovation.grid.utils
Class ScriptUtils

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

public class ScriptUtils
extends Object

Utility methods for handling scripts.


Constructor Summary
ScriptUtils()
           
 
Method Summary
static File getScript(File dir, String prefix)
          Get a script from a directory.
static String[] splitArguments(String arguments)
          Parse a string into an array of arguments.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScriptUtils

public ScriptUtils()
Method Detail

getScript

public static File getScript(File dir,
                             String prefix)
                      throws FileNotFoundException
Get a script from a directory.

Parameters:
dir - directory to search
prefix - prefix of script
Returns:
the single script starting with the prefix
Throws:
FileNotFoundException - if no such file exists or multiple files match

splitArguments

public static String[] splitArguments(String arguments)
Parse a string into an array of arguments. This method copes with quoted strings and backslash escapes.

Parameters:
arguments - the string to parse
Returns:
an array of arguments


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