org.apache.tomcat.util.http

Class FastHttpDateFormat

public final class FastHttpDateFormat extends Object

Utility class to generate HTTP dates.

Author: Remy Maucherat

Field Summary
protected static StringcurrentDate
Current formatted date.
protected static longcurrentDateGenerated
Instant on which the currentDate object was generated.
protected static intCACHE_SIZE
protected static SimpleDateFormatformat
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 TimeZonegmtZone
protected static ConcurrentHashMap<String,Long>parseCache
Parser cache.
Method Summary
static StringformatDate(long value, DateFormat threadLocalformat)
Get the HTTP format of the specified date.
static StringgetCurrentDate()
Get the current date in HTTP format.
static longparseDate(String value, DateFormat[] threadLocalformats)
Try to parse the given date as a HTTP date.

Field Detail

currentDate

protected static String currentDate
Current formatted date.

currentDateGenerated

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

CACHE_SIZE

protected static final int CACHE_SIZE

format

protected static final SimpleDateFormat format
HTTP date format.

formatCache

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

formats

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

gmtZone

protected static final TimeZone gmtZone

parseCache

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

Method Detail

formatDate

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

getCurrentDate

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

parseDate

public static final long parseDate(String value, DateFormat[] threadLocalformats)
Try to parse the given date as a HTTP date.
Copyright © 2000-2011 Apache Software Foundation. All Rights Reserved.