Class FastHttpDateFormat
- java.lang.Object
- 
- org.springframework.security.web.savedrequest.FastHttpDateFormat
 
- 
 public final class FastHttpDateFormat extends java.lang.ObjectUtility class to generate HTTP dates.This class is based on code in Apache Tomcat. 
- 
- 
Field SummaryFields Modifier and Type Field Description protected static java.lang.StringcurrentDateCurrent formatted date.protected static longcurrentDateGeneratedInstant on which the currentDate object was generated.protected static java.text.SimpleDateFormatformatHTTP date format.protected static java.util.HashMap<java.lang.Long,java.lang.String>formatCacheFormatter cache.protected static java.text.SimpleDateFormat[]formatsThe set of SimpleDateFormat formats to use ingetDateHeader().protected static java.util.TimeZonegmtZoneGMT time zone - all HTTP dates are on GMTprotected static java.util.HashMap<java.lang.String,java.lang.Long>parseCacheParser cache.
 - 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.StringformatDate(long value, java.text.DateFormat threadLocalformat)Formats a specified date to HTTP format.static java.lang.StringgetCurrentDate()Gets the current date in HTTP format.static longparseDate(java.lang.String value, java.text.DateFormat[] threadLocalformats)Tries to parse the given date as an HTTP date.
 
- 
- 
- 
Field Detail- 
formatprotected static final java.text.SimpleDateFormat format HTTP date format.
 - 
formatsprotected static final java.text.SimpleDateFormat[] formats The set of SimpleDateFormat formats to use ingetDateHeader().
 - 
gmtZoneprotected static final java.util.TimeZone gmtZone GMT time zone - all HTTP dates are on GMT
 - 
currentDateGeneratedprotected static long currentDateGenerated Instant on which the currentDate object was generated.
 - 
currentDateprotected static java.lang.String currentDate Current formatted date.
 - 
formatCacheprotected static final java.util.HashMap<java.lang.Long,java.lang.String> formatCache Formatter cache.
 - 
parseCacheprotected static final java.util.HashMap<java.lang.String,java.lang.Long> parseCache Parser cache.
 
- 
 - 
Method Detail- 
formatDatepublic static java.lang.String formatDate(long value, java.text.DateFormat threadLocalformat)Formats a specified date to HTTP format. If local format is notnull, it's used instead.- Parameters:
- value- Date value to format
- threadLocalformat- The format to use (or- null-- then HTTP format will be used)
- Returns:
- Formatted date
 
 - 
getCurrentDatepublic static java.lang.String getCurrentDate() Gets the current date in HTTP format.- Returns:
- Current date in HTTP format
 
 - 
parseDatepublic static long parseDate(java.lang.String value, java.text.DateFormat[] threadLocalformats)Tries to parse the given date as an HTTP date. If local format list is notnull, it's used instead.- Parameters:
- value- The string to parse
- threadLocalformats- Array of formats to use for parsing. If- null, HTTP formats are used.
- Returns:
- Parsed date (or -1 if error occurred)
 
 
- 
 
-