Spring for Apache Hadoop

org.springframework.yarn.support
Class ParsingUtils

java.lang.Object
  extended by org.springframework.yarn.support.ParsingUtils

public class ParsingUtils
extends java.lang.Object

Various static string and parsing utilities.

Author:
Janne Valkealahti

Constructor Summary
ParsingUtils()
           
 
Method Summary
static java.lang.String extractClasspath(java.lang.String source, java.lang.String delimiter)
          Extracts a classpath string from a source text.
static java.lang.String extractRunnableCommand(java.lang.String source)
          Extracts a string from another string which can be used as a command in shell.
static long parseBytes(java.lang.String string)
          Parses the count of bytes from a string.
static int parseBytesAsMegs(java.lang.String string)
          Parses the given string as a number representing megs.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParsingUtils

public ParsingUtils()
Method Detail

parseBytesAsMegs

public static int parseBytesAsMegs(java.lang.String string)
                            throws java.text.ParseException
Parses the given string as a number representing megs.

Parameters:
string - the value string
Returns:
the value as megs
Throws:
java.text.ParseException - the parse exception

parseBytes

public static long parseBytes(java.lang.String string)
                       throws java.text.ParseException
Parses the count of bytes from a string.

Parameters:
string - the value string
Returns:
the value as bytes
Throws:
java.text.ParseException - the parse exception

extractRunnableCommand

public static java.lang.String extractRunnableCommand(java.lang.String source)
Extracts a string from another string which can be used as a command in shell. Resulting string can't have any unnecessary spaces, line delimiters or any other characters which might prevent command to be run.

Parameters:
source - Source string
Returns:
Command string or null if error occurred

extractClasspath

public static java.lang.String extractClasspath(java.lang.String source,
                                                java.lang.String delimiter)
Extracts a classpath string from a source text.

Parameters:
source - the source string
delimiter - the delimiter
Returns:
classpath string

Spring for Apache Hadoop