com.oaklandsw.http
Class CookieContainer

java.lang.Object
  extended bycom.oaklandsw.http.CookieContainer
All Implemented Interfaces:
java.util.Collection

public class CookieContainer
extends java.lang.Object
implements java.util.Collection

Holds a set of cookies.


Constructor Summary
CookieContainer()
           
 
Method Summary
 boolean add(java.lang.Object o)
           
 boolean addAll(java.util.Collection c)
           
 void addCookie(Cookie cookie)
          Adds an HTTP cookie, replacing any existing equivalent cookies.
 void addCookies(Cookie[] cookies)
          Adds an array of HTTP cookies.
 void clear()
           
 boolean contains(java.lang.Object o)
           
 boolean containsAll(java.util.Collection c)
           
 Cookie[] getCookies()
          Returns an array of cookies that this HTTP state currently contains.
 boolean isEmpty()
           
 java.util.Iterator iterator()
           
 boolean purgeExpiredCookies()
          Removes all of cookies in this HTTP state that have expired according to the current system time.
 boolean purgeExpiredCookies(java.util.Date date)
          Removes all of cookies in this HTTP state that have expired by the specified date.
 boolean remove(java.lang.Object o)
           
 boolean removeAll(java.util.Collection c)
           
 boolean retainAll(java.util.Collection c)
           
 int size()
           
 java.lang.Object[] toArray()
           
 java.lang.Object[] toArray(java.lang.Object[] a)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Collection
equals, hashCode
 

Constructor Detail

CookieContainer

public CookieContainer()
Method Detail

addCookie

public void addCookie(Cookie cookie)
Adds an HTTP cookie, replacing any existing equivalent cookies. If the given cookie has already expired it will not be added, but existing values will still be removed.

Parameters:
cookie - the cookie to be added
See Also:
addCookies(Cookie[])

addCookies

public void addCookies(Cookie[] cookies)
Adds an array of HTTP cookies. Cookies are added individually and in the given array order. If any of the given cookies has already expired it will not be added, but existing values will still be removed.

Parameters:
cookies - the cookies to be added
See Also:
addCookie(Cookie)

getCookies

public Cookie[] getCookies()
Returns an array of cookies that this HTTP state currently contains.

Returns:
an array of cookies.

purgeExpiredCookies

public boolean purgeExpiredCookies()
Removes all of cookies in this HTTP state that have expired according to the current system time.

See Also:
purgeExpiredCookies(java.util.Date)

purgeExpiredCookies

public boolean purgeExpiredCookies(java.util.Date date)
Removes all of cookies in this HTTP state that have expired by the specified date.

Parameters:
date - The date to compare against.
Returns:
true if any cookies were purged.
See Also:
Cookie.isExpired(java.util.Date), purgeExpiredCookies()

size

public int size()
Specified by:
size in interface java.util.Collection

clear

public void clear()
Specified by:
clear in interface java.util.Collection

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface java.util.Collection

toArray

public java.lang.Object[] toArray()
Specified by:
toArray in interface java.util.Collection

add

public boolean add(java.lang.Object o)
Specified by:
add in interface java.util.Collection

contains

public boolean contains(java.lang.Object o)
Specified by:
contains in interface java.util.Collection

remove

public boolean remove(java.lang.Object o)
Specified by:
remove in interface java.util.Collection

addAll

public boolean addAll(java.util.Collection c)
Specified by:
addAll in interface java.util.Collection

containsAll

public boolean containsAll(java.util.Collection c)
Specified by:
containsAll in interface java.util.Collection

removeAll

public boolean removeAll(java.util.Collection c)
Specified by:
removeAll in interface java.util.Collection

retainAll

public boolean retainAll(java.util.Collection c)
Specified by:
retainAll in interface java.util.Collection

iterator

public java.util.Iterator iterator()
Specified by:
iterator in interface java.util.Collection

toArray

public java.lang.Object[] toArray(java.lang.Object[] a)
Specified by:
toArray in interface java.util.Collection

toString

public java.lang.String toString()


Copyright © 2002-2007 Oakland Software Incorporated. All Rights Reserved.