|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.faban.driver.transport.sunhttp.ThreadCookieHandler
public class ThreadCookieHandler
ThreadCookieHandler stores cookies from a response and retrieves all applicable cookies for a particular request. On retrieval, the cookies will be formatted as required. If a cookie does not specify a version when it is received - it is non-conformant to IEEE 2965 and 2109 - it is considered a cookie according to Netscape's original proposal. Such cookies will be formatted according to Netscape's proposal. A cookie that specifies a version is considered to follow IEEE2965 and 2109 even if version is 0. Such cookies will be formatted according to IEEE2965. In all cases, the selection rules specified in IEEE2965 applies.
Note that the interface of this cookie handler does not comply with java.net.ThreadCookieHandler.
Method Summary | |
---|---|
void |
addRequestCookies(HttpURLConnection c)
Adds the applicable cookies from the cookie handler to the request header of the connection. |
Map<String,List<String>> |
get(URI request,
Map<String,List<String>> requestHeaders)
Selects the cookies applicable to the request URI from the cookie store and puts them into the request header. |
String[] |
getCookieValuesByName(String name)
Obtains the value of all cookies in the cookie store by the name of the cookie. |
static ThreadCookieHandler |
getInstance()
Obtains the thread cookie handler for this thread. |
static void |
main(String[] args)
Main method to test cookie handler. |
static ThreadCookieHandler |
newInstance()
Creates a new instance of the thread cookie handler for this thread. |
void |
put(URI request,
Map<String,List<String>> responseHeaders)
Puts the cookies from the response headers into the cookie store. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static ThreadCookieHandler newInstance()
public static ThreadCookieHandler getInstance()
public void put(URI request, Map<String,List<String>> responseHeaders)
request
- The URI of the requestresponseHeaders
- The response headers.public Map<String,List<String>> get(URI request, Map<String,List<String>> requestHeaders)
request
- The request URIrequestHeaders
- The request header map
public void addRequestCookies(HttpURLConnection c) throws URISyntaxException
c
- The connection
URISyntaxException
public String[] getCookieValuesByName(String name)
name
- The cookie name
public static void main(String[] args) throws IOException, URISyntaxException
args
- Name of each file representing each request header
IOException
- Cannot find or read file
URISyntaxException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |