java.lang.Object
org.glassfish.grizzly.http.util.FastHttpDateFormat
Utility class to generate HTTP dates.
- Author:
- Gustav Trede, Remy Maucherat
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
formatDate
(long value, DateFormat threadLocalFormat) Get the HTTP format of the specified date.
http spec only requre second precision http://tools.ietf.org/html/rfc2616#page-20
therefore we dont use the millisecond precision , but second .static String
Get the current date in HTTP format.static byte[]
Get the current date in HTTP format.static long
parseDate
(String value, DateFormat[] threadLocalformats) Try to parse the given date as a HTTP date.
-
Constructor Details
-
FastHttpDateFormat
public FastHttpDateFormat()
-
-
Method Details
-
getCurrentDate
Get the current date in HTTP format. -
getCurrentDateBytes
public static byte[] getCurrentDateBytes()Get the current date in HTTP format. -
formatDate
Get the HTTP format of the specified date.
http spec only requre second precision http://tools.ietf.org/html/rfc2616#page-20
therefore we dont use the millisecond precision , but second . truncation is done in the same way for second precision in SimpleDateFormat:
(999 millisec. = 0 sec.)- Parameters:
value
- in milli-secondsthreadLocalFormat
- theDateFormat
used if cache value was not found
-
parseDate
Try to parse the given date as a HTTP date.
-