public abstract class PathUtils extends Object
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"
Formatter| Constructor and Description |
|---|
PathUtils() |
| Modifier and Type | Method and Description |
|---|---|
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. |
public static String format(String pathFormat, boolean appendUUID)
Formatter.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#dtappendUUID - Whether a UUID is appended to the generated pathpublic static String format(String pathFormat)
Formatter.pathFormat - Path format, the variable in the path will be
replaced by Date.public static String format(String pathFormat, Date date)
Formatter.pathFormat - Path format, the variable in the path will be
replaced by Date.date - date to usepublic static String format(String pathFormat, boolean appendUUID, Date date)
Formatter.pathFormat - Path format, the variable in the path will be
replaced by Date.appendUUID - whether or not to append a UUID at the enddate - date to use