Spec-Zone .ru
спецификации, руководства, описания, API
|
|
Java™ Platform Standard Ed. 6 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface CookieStore
A CookieStore object represents a storage for cookie. Can store and retrieve cookies.
CookieManager
will call CookieStore.add to save cookies
for every incoming HTTP response, and call CookieStore.get to
retrieve cookie for every outgoing HTTP request. A CookieStore
is responsible for removing HttpCookie instances which have expired.
Method Summary | |
---|---|
void |
add(URI uri,
HttpCookie cookie)
Adds one HTTP cookie to the store. |
List<HttpCookie> |
get(URI uri)
Retrieve cookies associated with given URI, or whose domain matches the given URI. |
List<HttpCookie> |
getCookies()
Get all not-expired cookies in cookie store. |
List<URI> |
getURIs()
Get all URIs which identify the cookies in this cookie store. |
boolean |
remove(URI uri,
HttpCookie cookie)
Remove a cookie from store. |
boolean |
removeAll()
Remove all cookies in this cookie store. |
Method Detail |
---|
void add(URI uri, HttpCookie cookie)
A cookie to store may or may not be associated with an URI. If it is not associated with an URI, the cookie's domain and path attribute will indicate where it comes from. If it is associated with an URI and its domain and path attribute are not speicifed, given URI will indicate where this cookie comes from.
If a cookie corresponding to the given URI already exists, then it is replaced with the new one.
uri
- the uri this cookie associated with.
if null, this cookie will not be associated
with an URIcookie
- the cookie to store
NullPointerException
- if cookie is nullget(java.net.URI)
List<HttpCookie> get(URI uri)
NullPointerException
- if uri is nulladd(java.net.URI, java.net.HttpCookie)
List<HttpCookie> getCookies()
List<URI> getURIs()
boolean remove(URI uri, HttpCookie cookie)
uri
- the uri this cookie associated with.
if null, the cookie to be removed is not associated
with an URI when added; if not null, the cookie
to be removed is associated with the given URI when added.cookie
- the cookie to remove
NullPointerException
- if cookie is nullboolean removeAll()
|
Java™ Platform Standard Ed. 6 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 2008 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Also see the