Class HttpDateFormat
java.lang.Object
org.glassfish.jersey.message.internal.HttpDateFormat
Helper class for HTTP specified date formats.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final String
The date format pattern for ANSI C asctime().private static final ThreadLocal<List<SimpleDateFormat>>
private static final TimeZone
private static final String
The date format pattern for RFC 1036.private static final String
The date format pattern for RFC 1123. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static List<SimpleDateFormat>
private static List<SimpleDateFormat>
Return an unmodifiable list of HTTP specified date formats to use for parsing or formattingDate
.static SimpleDateFormat
Get the preferred HTTP specified date format (RFC 1123).static Date
Read a date.
-
Field Details
-
RFC1123_DATE_FORMAT_PATTERN
The date format pattern for RFC 1123.- See Also:
-
RFC1036_DATE_FORMAT_PATTERN
The date format pattern for RFC 1036.- See Also:
-
ANSI_C_ASCTIME_DATE_FORMAT_PATTERN
The date format pattern for ANSI C asctime().- See Also:
-
GMT_TIME_ZONE
-
dateFormats
-
-
Constructor Details
-
HttpDateFormat
private HttpDateFormat()
-
-
Method Details
-
createDateFormats
-
getDateFormats
Return an unmodifiable list of HTTP specified date formats to use for parsing or formattingDate
.The list of date formats are scoped to the current thread and may be used without requiring to synchronize access to the instances when parsing or formatting.
- Returns:
- the list of data formats.
-
getPreferredDateFormat
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.
-
readDate
Read a date.- Parameters:
date
- the date as a string.- Returns:
- the date
- Throws:
ParseException
- in case the date string cannot be parsed.
-