org.archive.wayback.memento
Class TimeGateRequestParser
java.lang.Object
org.archive.wayback.requestparser.BaseRequestParser
org.archive.wayback.requestparser.WrappedRequestParser
org.archive.wayback.memento.TimeGateRequestParser
- All Implemented Interfaces:
- RequestParser
public class TimeGateRequestParser
- extends WrappedRequestParser
RequestParser subclass which matches ".../timegate/URL" requests, and parses
the Accept-Datetime header
|
Method Summary |
Date |
checkDateValidity(String httpdate,
List<SimpleDateFormat> list)
Attempt to parse the String httpdate argument using one of the
SimpleDateFormats provided. |
String |
getHttpDate(javax.servlet.http.HttpServletRequest req)
Extract the value of the "Accept-Datetime" HTTP request header, if
present, and further strips the date value from any surrounding "{","}" |
WaybackRequest |
parse(javax.servlet.http.HttpServletRequest httpRequest,
AccessPoint accessPoint)
attempt to transform an incoming HttpServletRequest into a
WaybackRequest object. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TimeGateRequestParser
public TimeGateRequestParser(BaseRequestParser wrapped)
- Parameters:
wrapped - BaseRequestParser with configuration
parse
public WaybackRequest parse(javax.servlet.http.HttpServletRequest httpRequest,
AccessPoint accessPoint)
throws BadQueryException,
BetterRequestException
- Description copied from interface:
RequestParser
- attempt to transform an incoming HttpServletRequest into a
WaybackRequest object. returns null if there is missing information.
- Specified by:
parse in interface RequestParser- Specified by:
parse in class BaseRequestParser
- Parameters:
httpRequest - ServletHttpRequest being handledaccessPoint - AccessPoint which is attempting to parse the request
- Returns:
- populated WaybackRequest object if successful, null otherwise.
- Throws:
BadQueryException - if the request could match this AccessPoint,
but is malformed: invalid datespec, URL, or flags
BetterRequestException - if the request should be redirected to
provide better user feedback (corrected URL/date in address bar)
getHttpDate
public String getHttpDate(javax.servlet.http.HttpServletRequest req)
- Extract the value of the "Accept-Datetime" HTTP request header, if
present, and further strips the date value from any surrounding "{","}"
- Parameters:
req - HttpServletRequest for this request
- Returns:
- the raw String containing the date information, or null if no
such HTTP header exists.
checkDateValidity
public Date checkDateValidity(String httpdate,
List<SimpleDateFormat> list)
- Attempt to parse the String httpdate argument using one of the
SimpleDateFormats provided.
- Parameters:
httpdate - String version of a Datelist - of SimpleDateFormats to parse the httpdate
- Returns:
- Date object set to the time parsed, or null if not parsed
Copyright © 2005-2011 Internet Archive. All Rights Reserved.