Package org.apache.nutch.net.protocols
Class HttpDateFormat
java.lang.Object
org.apache.nutch.net.protocols.HttpDateFormat
Parse and format HTTP dates in HTTP headers, e.g., used to fill the
"If-Modified-Since" request header field.
HTTP dates use Greenwich Mean Time (GMT) as time zone and a date format like:
Sun, 06 Nov 1994 08:49:37 GMTSee sec. 3.3.1 in RFC 2616 and sec. 7.1.1.1 in RFC 7231.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final DateTimeFormatterstatic final DateTimeFormatterUse a less restrictive format for parsing: accept single-digit day-of-month and any timezone -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidstatic Datestatic longstatic StringtoString(long millis) static Stringstatic StringGet the HTTP format of the specified date.static ZonedDateTimetoZonedDateTime(String dateString)
-
Field Details
-
FORMAT
-
PARSE_FORMAT
Use a less restrictive format for parsing: accept single-digit day-of-month and any timezone
-
-
Constructor Details
-
HttpDateFormat
public HttpDateFormat()
-
-
Method Details
-
toString
Get the HTTP format of the specified date.- Parameters:
date- aDatefor conversion- Returns:
- the String HTTP representation of the date
-
toString
-
toString
-
toZonedDateTime
- Throws:
ParseException
-
toDate
- Throws:
ParseException
-
toLong
- Throws:
ParseException
-
main
- Throws:
Exception
-