KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > matuschek > http > cookie > CookieManager


1 package net.matuschek.http.cookie;
2
3 /*********************************************
4     Copyright (c) 2001 by Daniel Matuschek
5 *********************************************/

6
7 import java.net.URL JavaDoc;
8                                          
9 /**
10  * This interface defines a container for storing cookies.
11  *
12  * @author Daniel Matuschek
13  * @version $Id $
14  */

15 public interface CookieManager
16 {
17
18   /**
19    * Add this cookie. If there is already a cookie with the same name and
20    * path it will be owerwritten by the new cookie.
21    * @param cookie a Cookie that will be stored in this cookie manager
22    */

23   public void add(Cookie cookie);
24
25
26   /**
27    * How many cookies are currently stored in this CookieManager ?
28    * @return the number of stored Cookies
29    */

30   public int countCookies();
31
32
33   /**
34    * Get the cookie values for the given URL.
35    * @return a String containing a list of NAME=VALUE pairs (separated by
36    * semicolon) containing all cookie values that are valid for the
37    * given URL, <br/ >
38    * null if no cookies can be found for this URL
39    */

40   public String JavaDoc cookiesForURL(URL JavaDoc u);
41
42
43   /**
44    * Remove all stored cookies
45    */

46   public void clear();
47
48   /**
49    * <b>Insiders BugFix</b>
50    * This method finishes the CleanUpThread.
51    */

52   public void finish();
53 }
54
Popular Tags