public class Cookies extends Object
Modifier and Type | Method and Description |
---|---|
void |
addCookie(Cookie cookie)
Adds the specified Cookie and removes any existing cookies with the same name and path.
|
void |
empty()
Removes every cookie.
|
List<Cookie> |
get(String domain)
Returns the List of cookies associated with the specified (case insentitive) domain.
|
List<Cookie> |
getCookies()
Returns a List of all cookies.
|
void |
loadCookies(File cookiesFile)
clears any existing cookies and loads cookies from the specified cookies file.
|
List<Cookie> |
remove(String domain)
Removes cookies for the specified (case insensitive) domain.
|
boolean |
removeCookie(Cookie cookie)
Removes the specified cookie.
|
void |
saveCookies(File outputFile)
Saves cookies to the specified file.
|
String |
toString()
Returns a string representation of the Cookies.
|
public List<Cookie> remove(String domain)
public List<Cookie> get(String domain)
public void addCookie(Cookie cookie)
public boolean removeCookie(Cookie cookie)
public String toString()
public void empty()
public void loadCookies(File cookiesFile) throws IOException, ClassNotFoundException
IOException
ClassNotFoundException
public void saveCookies(File outputFile) throws IOException
IOException