|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectvelosurf.util.FastHttpDateFormat
public class FastHttpDateFormat
Utility class to generate HTTP dates.
This source code is taken from Tomcat Apache
| Field Summary | |
|---|---|
private static java.lang.String |
currentDate
Current formatted date. |
private static long |
currentDateGenerated
Instant on which the currentDate object was generated. |
private static java.text.SimpleDateFormat |
format
HTTP date format. |
private static java.util.HashMap |
formatCache
Formatter cache. |
private static java.text.SimpleDateFormat[] |
formats
The set of SimpleDateFormat formats to use in getDateHeader(). |
private static java.util.TimeZone |
gmtZone
GMT timezone - all HTTP dates are on GMT |
private static java.util.HashMap |
parseCache
Parser cache. |
| Constructor Summary | |
|---|---|
FastHttpDateFormat()
|
|
| Method Summary | |
|---|---|
static java.lang.String |
formatDate(long value,
java.text.DateFormat threadLocalformat)
Formats a specified date to HTTP format. |
static java.lang.String |
getCurrentDate()
Gets the current date in HTTP format. |
private static java.lang.Long |
internalParseDate(java.lang.String value,
java.text.DateFormat[] formats)
Parses date with given formatters. |
static long |
parseDate(java.lang.String value,
java.text.DateFormat[] threadLocalformats)
Tries to parse the given date as an HTTP date. |
private static void |
updateCache(java.util.HashMap cache,
java.lang.Object key,
java.lang.Object value)
Updates cache. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final java.text.SimpleDateFormat format
private static final java.text.SimpleDateFormat[] formats
getDateHeader().
private static final java.util.TimeZone gmtZone
private static long currentDateGenerated
private static java.lang.String currentDate
private static final java.util.HashMap formatCache
private static final java.util.HashMap parseCache
| Constructor Detail |
|---|
public FastHttpDateFormat()
| Method Detail |
|---|
public static final java.lang.String getCurrentDate()
public static final java.lang.String formatDate(long value,
java.text.DateFormat threadLocalformat)
null, it's used instead.
value - Date value to formatthreadLocalformat - The format to use (or null -- then
HTTP format will be used)
public static final long parseDate(java.lang.String value,
java.text.DateFormat[] threadLocalformats)
null, it's used instead.
value - The string to parsethreadLocalformats - Array of formats to use for parsing.
If null, HTTP formats are used.
private static final java.lang.Long internalParseDate(java.lang.String value,
java.text.DateFormat[] formats)
value - The string to parseformats - Array of formats to use
null if no formatter mached)
private static final void updateCache(java.util.HashMap cache,
java.lang.Object key,
java.lang.Object value)
cache - Cache to be updatedkey - Key to be updatedvalue - New value
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||