com.sun.grizzly.util.http
Class FastHttpDateFormat

java.lang.Object
  extended by com.sun.grizzly.util.http.FastHttpDateFormat

public final class FastHttpDateFormat
extends Object

Utility class to generate HTTP dates.

Author:
Remy Maucherat

Field Summary
protected static int CACHE_SIZE
           
protected static String currentDate
          Current formatted date.
protected static long currentDateGenerated
          Instant on which the currentDate object was generated.
protected static SimpleDateFormat format
          HTTP date format.
protected static ConcurrentHashMap<Long,String> formatCache
          Formatter cache.
protected static SimpleDateFormat[] formats
          The set of SimpleDateFormat formats to use in getDateHeader().
protected static TimeZone gmtZone
           
protected static ConcurrentHashMap<String,Long> parseCache
          Parser cache.
 
Constructor Summary
FastHttpDateFormat()
           
 
Method Summary
static String formatDate(long value, DateFormat threadLocalformat)
          Get the HTTP format of the specified date.
static String getCurrentDate()
          Get the current date in HTTP format.
static long parseDate(String value, DateFormat[] threadLocalformats)
          Try to parse the given date as a HTTP date.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CACHE_SIZE

protected static final int CACHE_SIZE

format

protected static final SimpleDateFormat format
HTTP date format.


formats

protected static final SimpleDateFormat[] formats
The set of SimpleDateFormat formats to use in getDateHeader().


gmtZone

protected static final TimeZone gmtZone

currentDateGenerated

protected static long currentDateGenerated
Instant on which the currentDate object was generated.


currentDate

protected static String currentDate
Current formatted date.


formatCache

protected static final ConcurrentHashMap<Long,String> formatCache
Formatter cache.


parseCache

protected static final ConcurrentHashMap<String,Long> parseCache
Parser cache.

Constructor Detail

FastHttpDateFormat

public FastHttpDateFormat()
Method Detail

getCurrentDate

public static final String getCurrentDate()
Get the current date in HTTP format.


formatDate

public static final String formatDate(long value,
                                      DateFormat threadLocalformat)
Get the HTTP format of the specified date.


parseDate

public static final long parseDate(String value,
                                   DateFormat[] threadLocalformats)
Try to parse the given date as a HTTP date.



Copyright © 2010 SUN Microsystems. All Rights Reserved.