01: package net.matuschek.http.cookie;
02:
03: /*********************************************
04: Copyright (c) 2001 by Daniel Matuschek
05: *********************************************/
06:
07: import java.net.URL;
08:
09: /**
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: * Add this cookie. If there is already a cookie with the same name and
19: * path it will be owerwritten by the new cookie.
20: * @param cookie a Cookie that will be stored in this cookie manager
21: */
22: public void add(Cookie cookie);
23:
24: /**
25: * How many cookies are currently stored in this CookieManager ?
26: * @return the number of stored Cookies
27: */
28: public int countCookies();
29:
30: /**
31: * Get the cookie values for the given URL.
32: * @return a String containing a list of NAME=VALUE pairs (separated by
33: * semicolon) containing all cookie values that are valid for the
34: * given URL, <br/ >
35: * null if no cookies can be found for this URL
36: */
37: public String cookiesForURL(URL u);
38:
39: /**
40: * Remove all stored cookies
41: */
42: public void clear();
43:
44: /**
45: * <b>Insiders BugFix</b>
46: * This method finishes the CleanUpThread.
47: */
48: public void finish();
49: }
|