| |
|
| java.lang.Object com.lutris.http.HttpCookieParser
HttpCookieParser | public class HttpCookieParser (Code) | | This class takes a cookie header and converts it into a
set of http cookies. It can be used to parse request and
response cookie headers as well as format response cookies.
author: Kyle Clark version: $Revision: 1.2 $ since: Harmony1.0 |
Method Summary | |
public static int | expiresToMaxAge(String dateStr) Convert an old cookie expires data to maximum age; assuming now
as the start.
Parameters: dateStr - The string expiry date. | public static String | formatResponseCookie(Cookie cookie) Format a Cookie for a response header.
Parameters: The - cookie to format. | public static String | maxAgeToExpires(int maxAge) Convert amaximum age to a old cookie expires data; assuming now
as the start.
Parameters: The - max age, in seconds. | public static Cookie | parseCookieString(String cookieString) | public static Vector | parseRequestHeader(String httpReqCookieHeader) Parses an http cookie request header and returns a vector
of Cookie objects defined in the header. | public static Cookie | parseRequestHeader(String httpReqCookieHeader, String name) Parses an http cookie request header and returns the first
cookie that matches the specified name. | public static Vector | parseResponseHeader(String httpResponseCookieHeader) Parses an http cookie response header and returns a vector
of Cookie objects defined in the header. |
expiresToMaxAge | public static int expiresToMaxAge(String dateStr)(Code) | | Convert an old cookie expires data to maximum age; assuming now
as the start.
Parameters: dateStr - The string expiry date. The max age, in seconds. |
formatResponseCookie | public static String formatResponseCookie(Cookie cookie)(Code) | | Format a Cookie for a response header.
Parameters: The - cookie to format. The value for the header (name is not included). |
maxAgeToExpires | public static String maxAgeToExpires(int maxAge)(Code) | | Convert amaximum age to a old cookie expires data; assuming now
as the start.
Parameters: The - max age, in seconds. The string expiry date. |
parseRequestHeader | public static Vector parseRequestHeader(String httpReqCookieHeader)(Code) | | Parses an http cookie request header and returns a vector
of Cookie objects defined in the header. This method
should only be used with the request cookie header "Cookie:".
Parameters: httpReqCookieHeader - The http cookie request header to parse.vector containing the cookies defined in the header. |
parseRequestHeader | public static Cookie parseRequestHeader(String httpReqCookieHeader, String name)(Code) | | Parses an http cookie request header and returns the first
cookie that matches the specified name. This method
should only be used with the request cookie header "Cookie:".
Parameters: httpReqCookieHeader - The http cookie request header to parse. Parameters: name - The cookie name of interest.The first cookie that matches. null if no matching cookiesare found. |
parseResponseHeader | public static Vector parseResponseHeader(String httpResponseCookieHeader)(Code) | | Parses an http cookie response header and returns a vector
of Cookie objects defined in the header. This method
only works with http response headers, (i.e. Set-Cookie).
Parameters: httpResponseCookieHeader - The http cookie response header from which the cookiesare constructed.Vector containing the cookies defined in the header. |
|
|
|