Class HttpDateFormat
- java.lang.Object
-
- org.glassfish.jersey.message.internal.HttpDateFormat
-
public final class HttpDateFormat extends Object
Helper class for HTTP specified date formats.- Author:
- Paul Sandoz, Marek Potociar
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceHttpDateFormat.HttpDateFormatter
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static SimpleDateFormatgetPreferredDateFormat()Deprecated, for removal: This API element is subject to removal in a future version.Use getPreferredDateFormatter insteadstatic HttpDateFormat.HttpDateFormattergetPreferredDateFormatter()Get the preferred HTTP specified date format (RFC 1123).static DatereadDate(String date)Read a date.
-
-
-
Method Detail
-
getPreferredDateFormatter
public static HttpDateFormat.HttpDateFormatter getPreferredDateFormatter()
Get the preferred HTTP specified date format (RFC 1123).The date format is scoped to the current thread and may be used without requiring to synchronize access to the instance when parsing or formatting.
- Returns:
- the preferred of data format.
-
getPreferredDateFormat
@Deprecated(forRemoval=true) public static SimpleDateFormat getPreferredDateFormat()
Deprecated, for removal: This API element is subject to removal in a future version.Use getPreferredDateFormatter insteadGet the preferred HTTP specified date format (RFC 1123).The date format is scoped to the current thread and may be used without requiring to synchronize access to the instance when parsing or formatting.
- Returns:
- the preferred of data format.
-
readDate
public static Date readDate(String date) throws ParseException
Read a date.- Parameters:
date- the date as a string.- Returns:
- the date
- Throws:
ParseException- in case the date string cannot be parsed.
-
-