org.springframework.data.hadoop.util
Class PathUtils

java.lang.Object
  extended by org.springframework.data.hadoop.util.PathUtils

public abstract class PathUtils
extends Object

Utility for generating date-based paths. Relies on the Formatter style.

For example, to generate the following path "/user/hadoop/data/2012/2/22/17/20/10" the input format can be "/user/hadoop/data/%1$tY/%1$tm/%1$td/%1$tH/%1$tM/%1$tS"

Author:
Jarred Li
See Also:
Formatter

Constructor Summary
PathUtils()
           
 
Method Summary
static String format(String pathFormat)
          Generates a timed-based path, based on the current date, using the format of Formatter.
static String format(String pathFormat, boolean appendUUID)
          Generates a timed-based path, based on the current date, using the format of Formatter.
static String format(String pathFormat, boolean appendUUID, Date date)
          Generates a timed-based path, based on the given date, using the format of Formatter.
static String format(String pathFormat, Date date)
          Generates a timed-based path, based on the given date, using the format of Formatter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PathUtils

public PathUtils()
Method Detail

format

public static String format(String pathFormat,
                            boolean appendUUID)
Generates a timed-based path, based on the current date, using the format of Formatter.

Parameters:
pathFormat - Formatted path, the variable in the path will be replaced by Date. http://docs.oracle.com/javase/6/docs/api/java/util/Formatter.html#dt
appendUUID - Whether a UUID is appended to the generated path
Returns:
generated path

format

public static String format(String pathFormat)
Generates a timed-based path, based on the current date, using the format of Formatter.

Parameters:
pathFormat - Path format, the variable in the path will be replaced by Date.
Returns:
generated path

format

public static String format(String pathFormat,
                            Date date)
Generates a timed-based path, based on the given date, using the format of Formatter.

Parameters:
pathFormat - Path format, the variable in the path will be replaced by Date.
Returns:
generated path

format

public static String format(String pathFormat,
                            boolean appendUUID,
                            Date date)
Generates a timed-based path, based on the given date, using the format of Formatter.

Parameters:
pathFormat - Path format, the variable in the path will be replaced by Date.
appendUUID - whether or not to append a UUID at the end
date - date to use
Returns:
generated path