cookiemanager.java

来自「真正的网络爬虫的源代码啊,希望大家好好阅读,写出心得体会啊」· Java 代码 · 共 54 行

JAVA
54
字号
package net.matuschek.http.cookie;

/*********************************************
    Copyright (c) 2001 by Daniel Matuschek
*********************************************/

import java.net.URL;
                                         
/**
 * This interface defines a container for storing cookies.
 * 
 * @author Daniel Matuschek 
 * @version $Id $
 */
public interface CookieManager
{

  /** 
   * Add this cookie. If there is already a cookie with the same name and
   * path it will be owerwritten by the new cookie.
   * @param cookie a Cookie that will be stored in this cookie manager
   */
  public void add(Cookie cookie);


  /** 
   * How many cookies are currently stored in this CookieManager ?
   * @return the number of stored Cookies
   */
  public int countCookies();


  /** 
   * Get the cookie values for the given URL.
   * @return a String containing a list of NAME=VALUE pairs (separated by
   * semicolon) containing all cookie values that are valid for the
   * given URL, <br/ >
   * null if no cookies can be found for this URL
   */
  public String cookiesForURL(URL u);


  /**
   * Remove all stored cookies
   */
  public void clear();

  /**
   * <b>Insiders BugFix</b>
   * This method finishes the CleanUpThread.
   */
  public void finish();
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?