|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.weborganic.bastille.cache.util.HttpDateFormat
public final class HttpDateFormat
A date format to produce and parse dates compliant with the RFC 2616 - HTTP/1.1 protocol.
Section 3.3.1 defines the preferred full date and time as:
HTTP-date = rfc1123-date rfc1123-date = wkday "," SP date1 SP time SP "GMT" date1 = 2DIGIT SP month SP 4DIGIT ; day month year (e.g., 02 Jun 1982) time = 2DIGIT ":" 2DIGIT ":" 2DIGIT ; 00:00:00 - 23:59:59 wkday = "Mon" | "Tue" | "Wed" | "Thu" | "Fri" | "Sat" | "Sun" month = "Jan" | "Feb" | "Mar" | "Apr" | "May" | "Jun" | "Jul" | "Aug" | "Sep" | "Oct" | "Nov" | "Dec"For example:
Sun, 07 Jan 2013 04:17:56 GMT
Constructor Summary | |
---|---|
HttpDateFormat()
Creates a new formatter. |
Method Summary | |
---|---|
String |
format(Date date)
Formats the specified date. |
Date |
parse(String date)
Parses dates supplied in accordance with Section 3.3.1 of RFC 2616 |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HttpDateFormat()
Method Detail |
---|
public String format(Date date)
date
- The date to format
public Date parse(String date)
If the date cannot be parsed, the start of POSIX time, 1/1/1970 is returned, which will have the effect of expiring the content.
date
- a date formatted in accordance with Section 3.3.1 of RFC 2616
0L
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |