|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jniwrapper.win32.ie.cookie.CookieManager
public class CookieManager
The class allows working with persistent or session cookies.
The all persistent cookies stored in the windows\cookies directory and have an expiration date set sometime in the future.
The session cookies do not have an an expiration date and created in the same process. These cookies are not written to any files.
Method Summary | |
---|---|
void |
deleteAllPersistentCookies()
Removes all persistent cookies. |
void |
deleteCookie(java.net.URL domain,
Cookie cookie)
Deletes persistent or session cookie. |
void |
deletePersistentCookie(Cookie cookie)
Removes specified persistent cookie. |
java.util.Set<Cookie> |
getCookies(java.net.URL url)
Returns cookies, that are associated with the specified URL. |
java.util.Set<Cookie> |
getCookies(java.net.URL url,
WebBrowser browser)
Returns persistent cookies and session cookies for a given browser instance,
that are associated with the given url . |
static CookieManager |
getInstance()
|
java.util.Set<Cookie> |
getPersistentCookies()
Returns the all persistent cookies stored in the windows\cookies directory and that have an expiration date set sometime in the future. |
void |
setCookie(java.net.URL url,
Cookie cookie)
Creates a new cookies for the specified URL using WinINet API. |
void |
setCookies(java.net.URL url,
java.util.Set<Cookie> cookies)
Creates a new cookies for the specified URL using WinINet API. |
void |
setCookies(java.net.URL url,
java.util.Set<Cookie> cookies,
WebBrowser browser)
Creates a new cookies for a specified url and browser instance. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static CookieManager getInstance()
public java.util.Set<Cookie> getPersistentCookies()
public java.util.Set<Cookie> getCookies(java.net.URL url)
InternetGetCookie
native function.
It checks in the windows\cookies directory for persistent cookies that have an expiration date set sometime in the future.
It also searches memory for any session cookies, that is, cookies that do not have an expiration date that were created in the same process by CookieManager.setCookie(), because these cookies are not written to any files. Rules for creating cookie files are internal to the system and can change in the future.
Note: The method does not return cookies that the server marked as non-scriptable with the "HttpOnly" attribute in the Set-Cookie header.
url
- specifies an URL.
public java.util.Set<Cookie> getCookies(java.net.URL url, WebBrowser browser)
browser
instance,
that are associated with the given url
.
url
- specifies an URL.browser
- the browser instance which session cookies this method returns.
WebBrowser.getCookies(java.net.URL)
public void setCookies(java.net.URL url, java.util.Set<Cookie> cookies)
InternetSetCookie
native function.
Cookies created by this method without an expiration date are stored in memory and are available only in the same process that created them. Cookies that include an expiration date are stored in the windows\cookies directory.
url
- specifies an URL, a new cookie will be associated with.cookies
- the collection of Cookie
objects.public void setCookies(java.net.URL url, java.util.Set<Cookie> cookies, WebBrowser browser)
cookies
for a specified url
and browser
instance.
url
- specifies an URL, a new cookie will be associated with.cookies
- the collection of Cookie
objects.browser
- the browser instance for which session cookies will be available.WebBrowser.setCookies(java.net.URL, java.util.Set)
public void setCookie(java.net.URL url, Cookie cookie)
InternetSetCookie
native function.
Cookies created by this method without an expiration date are stored in memory and are available only in the same process that created them. Cookies that include an expiration date are stored in the windows\cookies directory.
url
- specifies an URL, a new cookie will be associated with.cookie
- specifies a new cookie.public void deletePersistentCookie(Cookie cookie)
cookie
- specified persistent cookie.public void deleteAllPersistentCookies()
public void deleteCookie(java.net.URL domain, Cookie cookie)
domain
- the domain of this cookie.cookie
- the cookie to delete.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |