亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? cookiespecbase.java

?? 爬蟲
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
/* * $Header: /cvsroot/archive-crawler/ArchiveOpenCrawler/src/java/org/apache/commons/httpclient/cookie/CookieSpecBase.java,v 1.2 2005/08/08 19:38:24 gojomo Exp $ * $Revision: 1.2 $ * $Date: 2005/08/08 19:38:24 $ * * ==================================================================== * *  Copyright 2002-2004 The Apache Software Foundation * *  Licensed under the Apache License, Version 2.0 (the "License"); *  you may not use this file except in compliance with the License. *  You may obtain a copy of the License at * *      http://www.apache.org/licenses/LICENSE-2.0 * *  Unless required by applicable law or agreed to in writing, software *  distributed under the License is distributed on an "AS IS" BASIS, *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *  See the License for the specific language governing permissions and *  limitations under the License. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Software Foundation.  For more * information on the Apache Software Foundation, please see * <http://www.apache.org/>. * */ package org.apache.commons.httpclient.cookie;import java.util.Collection;import java.util.Date;import java.util.Iterator;import java.util.LinkedList;import java.util.List;import java.util.SortedMap;import org.apache.commons.httpclient.Cookie;import org.apache.commons.httpclient.Header;import org.apache.commons.httpclient.HeaderElement;import org.apache.commons.httpclient.NameValuePair;import org.apache.commons.httpclient.util.DateParseException;import org.apache.commons.httpclient.util.DateUtil;import org.apache.commons.logging.Log;import org.apache.commons.logging.LogFactory;import com.sleepycat.collections.StoredIterator;/** *  * Cookie management functions shared by all specification. * * @author  B.C. Holmes * @author <a href="mailto:jericho@thinkfree.com">Park, Sung-Gu</a> * @author <a href="mailto:dsale@us.britannica.com">Doug Sale</a> * @author Rod Waldhoff * @author dIon Gillard * @author Sean C. Sullivan * @author <a href="mailto:JEvans@Cyveillance.com">John Evans</a> * @author Marc A. Saegesser * @author <a href="mailto:oleg@ural.ru">Oleg Kalnichevski</a> * @author <a href="mailto:mbowler@GargoyleSoftware.com">Mike Bowler</a> *  * @since 2.0  */public class CookieSpecBase implements CookieSpec {        /** Log object */    protected static final Log LOG = LogFactory.getLog(CookieSpec.class);    /** Valid date patterns */    private Collection datepatterns = null;        /** Default constructor */    public CookieSpecBase() {        super();    }    /**      * Parses the Set-Cookie value into an array of <tt>Cookie</tt>s.      *      * <P>The syntax for the Set-Cookie response header is:      *      * <PRE>      * set-cookie      =    "Set-Cookie:" cookies      * cookies         =    1#cookie      * cookie          =    NAME "=" VALUE * (";" cookie-av)      * NAME            =    attr      * VALUE           =    value      * cookie-av       =    "Comment" "=" value      *                 |    "Domain" "=" value      *                 |    "Max-Age" "=" value      *                 |    "Path" "=" value      *                 |    "Secure"      *                 |    "Version" "=" 1*DIGIT      * </PRE>      *      * @param host the host from which the <tt>Set-Cookie</tt> value was      * received      * @param port the port from which the <tt>Set-Cookie</tt> value was      * received      * @param path the path from which the <tt>Set-Cookie</tt> value was      * received      * @param secure <tt>true</tt> when the <tt>Set-Cookie</tt> value was      * received over secure conection      * @param header the <tt>Set-Cookie</tt> received from the server      * @return an array of <tt>Cookie</tt>s parsed from the Set-Cookie value      * @throws MalformedCookieException if an exception occurs during parsing      */    public Cookie[] parse(String host, int port, String path,         boolean secure, final String header)         throws MalformedCookieException {                    LOG.trace("enter CookieSpecBase.parse("             + "String, port, path, boolean, Header)");        if (host == null) {            throw new IllegalArgumentException(                "Host of origin may not be null");        }        if (host.trim().equals("")) {            throw new IllegalArgumentException(                "Host of origin may not be blank");        }        if (port < 0) {            throw new IllegalArgumentException("Invalid port: " + port);        }        if (path == null) {            throw new IllegalArgumentException(                "Path of origin may not be null.");        }        if (header == null) {            throw new IllegalArgumentException("Header may not be null.");        }        if (path.trim().equals("")) {            path = PATH_DELIM;        }        host = host.toLowerCase();        String defaultPath = path;            int lastSlashIndex = defaultPath.lastIndexOf(PATH_DELIM);        if (lastSlashIndex >= 0) {            if (lastSlashIndex == 0) {                //Do not remove the very first slash                lastSlashIndex = 1;            }            defaultPath = defaultPath.substring(0, lastSlashIndex);        }        HeaderElement[] headerElements = null;        boolean isNetscapeCookie = false;         int i1 = header.toLowerCase().indexOf("expires=");        if (i1 != -1) {            i1 += "expires=".length();            int i2 = header.indexOf(";", i1);            if (i2 == -1) {                i2 = header.length();             }            try {                DateUtil.parseDate(header.substring(i1, i2), this.datepatterns);                isNetscapeCookie = true;             } catch (DateParseException e) {                // Does not look like a valid expiry date            }        }        if (isNetscapeCookie) {            headerElements = new HeaderElement[] {                    new HeaderElement(header.toCharArray())            };        } else {            headerElements = HeaderElement.parseElements(header.toCharArray());        }                Cookie[] cookies = new Cookie[headerElements.length];        for (int i = 0; i < headerElements.length; i++) {            HeaderElement headerelement = headerElements[i];            Cookie cookie = null;            try {                cookie = new Cookie(host,                                    headerelement.getName(),                                    headerelement.getValue(),                                    defaultPath,                                     null,                                    false);            } catch (IllegalArgumentException e) {                throw new MalformedCookieException(e.getMessage());             }            // cycle through the parameters            NameValuePair[] parameters = headerelement.getParameters();            // could be null. In case only a header element and no parameters.            if (parameters != null) {                for (int j = 0; j < parameters.length; j++) {                    parseAttribute(parameters[j], cookie);                }            }            cookies[i] = cookie;        }        return cookies;    }    /**      * Parse the <tt>"Set-Cookie"</tt> {@link Header} into an array of {@link      * Cookie}s.      *      * <P>The syntax for the Set-Cookie response header is:      *      * <PRE>      * set-cookie      =    "Set-Cookie:" cookies      * cookies         =    1#cookie      * cookie          =    NAME "=" VALUE * (";" cookie-av)      * NAME            =    attr      * VALUE           =    value      * cookie-av       =    "Comment" "=" value      *                 |    "Domain" "=" value      *                 |    "Max-Age" "=" value      *                 |    "Path" "=" value      *                 |    "Secure"      *                 |    "Version" "=" 1*DIGIT      * </PRE>      *      * @param host the host from which the <tt>Set-Cookie</tt> header was      * received      * @param port the port from which the <tt>Set-Cookie</tt> header was      * received      * @param path the path from which the <tt>Set-Cookie</tt> header was      * received      * @param secure <tt>true</tt> when the <tt>Set-Cookie</tt> header was      * received over secure conection      * @param header the <tt>Set-Cookie</tt> received from the server      * @return an array of <tt>Cookie</tt>s parsed from the <tt>"Set-Cookie"      * </tt> header      * @throws MalformedCookieException if an exception occurs during parsing      */    public Cookie[] parse(        String host, int port, String path, boolean secure, final Header header)        throws MalformedCookieException {                    LOG.trace("enter CookieSpecBase.parse("            + "String, port, path, boolean, String)");        if (header == null) {            throw new IllegalArgumentException("Header may not be null.");        }        return parse(host, port, path, secure, header.getValue());    }    /**      * Parse the cookie attribute and update the corresponsing {@link Cookie}      * properties.      *      * @param attribute {@link HeaderElement} cookie attribute from the      * <tt>Set- Cookie</tt>      * @param cookie {@link Cookie} to be updated      * @throws MalformedCookieException if an exception occurs during parsing      */    public void parseAttribute(        final NameValuePair attribute, final Cookie cookie)        throws MalformedCookieException {                    if (attribute == null) {            throw new IllegalArgumentException("Attribute may not be null.");        }        if (cookie == null) {            throw new IllegalArgumentException("Cookie may not be null.");        }        final String paramName = attribute.getName().toLowerCase();        String paramValue = attribute.getValue();        if (paramName.equals("path")) {            if ((paramValue == null) || (paramValue.trim().equals(""))) {                paramValue = "/";            }            cookie.setPath(paramValue);            cookie.setPathAttributeSpecified(true);        } else if (paramName.equals("domain")) {            if (paramValue == null) {                throw new MalformedCookieException(                    "Missing value for domain attribute");            }            if (paramValue.trim().equals("")) {                throw new MalformedCookieException(                    "Blank value for domain attribute");            }            cookie.setDomain(paramValue);            cookie.setDomainAttributeSpecified(true);        } else if (paramName.equals("max-age")) {            if (paramValue == null) {                throw new MalformedCookieException(                    "Missing value for max-age attribute");            }            int age;            try {                age = Integer.parseInt(paramValue);            } catch (NumberFormatException e) {                throw new MalformedCookieException ("Invalid max-age "                    + "attribute: " + e.getMessage());            }            cookie.setExpiryDate(                new Date(System.currentTimeMillis() + age * 1000L));        } else if (paramName.equals("secure")) {            cookie.setSecure(true);        } else if (paramName.equals("comment")) {            cookie.setComment(paramValue);        } else if (paramName.equals("expires")) {            if (paramValue == null) {                throw new MalformedCookieException(                    "Missing value for expires attribute");            }            try {                cookie.setExpiryDate(DateUtil.parseDate(paramValue, this.datepatterns));            } catch (DateParseException dpe) {                LOG.debug("Error parsing cookie date", dpe);                throw new MalformedCookieException(                    "Unable to parse expiration date parameter: "                     + paramValue);            }        } else {            if (LOG.isDebugEnabled()) {                LOG.debug("Unrecognized cookie attribute: "                     + attribute.toString());            }        }    }        public Collection getValidDateFormats() {        return this.datepatterns;    }    public void setValidDateFormats(final Collection datepatterns) {        this.datepatterns = datepatterns;    }    /**      * Performs most common {@link Cookie} validation      *      * @param host the host from which the {@link Cookie} was received

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产综合色在线视频区| 国产精品影音先锋| 国产日韩欧美精品在线| 欧美亚洲动漫精品| 国产成人亚洲综合a∨婷婷图片 | 精品88久久久久88久久久| 91偷拍与自偷拍精品| 蓝色福利精品导航| 亚洲电影视频在线| 中文字幕一区二区三区精华液 | 日韩欧美一二区| 91女人视频在线观看| 国精产品一区一区三区mba桃花| 一区二区三区欧美激情| 欧美国产一区在线| 欧美精品一区二区在线观看| 欧美日韩国产欧美日美国产精品| 成人av在线播放网站| 激情欧美日韩一区二区| 日韩精彩视频在线观看| 一区二区三区在线视频播放| 日本一区二区三区四区在线视频| 日韩欧美中文字幕公布| 欧美日韩成人综合天天影院| 91捆绑美女网站| 99综合影院在线| 国产69精品久久99不卡| 国产乱码一区二区三区| 美女网站在线免费欧美精品| 午夜不卡在线视频| 亚洲一区自拍偷拍| 亚洲精品高清视频在线观看| 亚洲欧洲日韩综合一区二区| 国产欧美日韩中文久久| 久久嫩草精品久久久久| 久久午夜老司机| 久久综合色天天久久综合图片| 亚洲综合视频在线| 亚洲美女区一区| 中文字幕亚洲电影| 亚洲欧洲精品一区二区三区不卡| 日本一区二区三区四区| 国产欧美日韩中文久久| 欧美激情一二三区| 国产精品久久久久久久久晋中| 久久精品一区四区| 国产女人aaa级久久久级 | 亚洲一二三区不卡| 亚洲国产美国国产综合一区二区| 夜夜精品视频一区二区| 亚洲超碰精品一区二区| 婷婷开心激情综合| 奇米精品一区二区三区在线观看 | 顶级嫩模精品视频在线看| 丁香一区二区三区| 色狠狠色狠狠综合| 欧美少妇一区二区| 日韩美女视频一区二区在线观看| 精品国精品国产| 国产精品美女一区二区在线观看| 日韩一区中文字幕| 亚洲国产一区二区视频| 免费欧美在线视频| 国产成人精品免费视频网站| 97久久久精品综合88久久| 色综合久久88色综合天天| 欧美久久一二三四区| 精品黑人一区二区三区久久| 国产精品午夜免费| 亚洲激情图片小说视频| 日韩高清一区在线| 精品一区二区三区视频在线观看| 国产69精品久久久久777| 在线观看亚洲a| 精品国产免费人成电影在线观看四季 | 亚洲一区二三区| 免费三级欧美电影| 成人精品小蝌蚪| 欧美日韩在线免费视频| 亚洲精品在线免费播放| 亚洲图片另类小说| 蜜臀久久99精品久久久画质超高清 | 亚洲精品成人天堂一二三| 五月婷婷久久综合| 国产91色综合久久免费分享| 欧洲一区二区三区在线| 亚洲精品一区二区三区福利| 亚洲欧美韩国综合色| 六月丁香婷婷久久| 91在线云播放| 日韩美女在线视频| 一区二区欧美在线观看| 麻豆精品一二三| 91麻豆视频网站| 久久亚洲私人国产精品va媚药| 亚洲欧美成aⅴ人在线观看| 美女视频一区二区三区| 日本精品裸体写真集在线观看| 欧美一级一区二区| 亚洲欧洲日韩av| 国产乱淫av一区二区三区| 欧美午夜寂寞影院| 亚洲国产电影在线观看| 毛片一区二区三区| 欧美丝袜自拍制服另类| 国产精品天干天干在观线| 日本视频在线一区| 欧美私模裸体表演在线观看| 国产精品第五页| 国产成人一区二区精品非洲| 日韩三级在线观看| 亚洲午夜成aⅴ人片| eeuss鲁片一区二区三区在线观看| 日韩三级在线免费观看| 天堂久久久久va久久久久| 99精品欧美一区二区三区小说| 久久久噜噜噜久久人人看| 日韩中文欧美在线| 日本乱码高清不卡字幕| 国产一区二区伦理片| 欧美日韩国产首页| 亚洲男人的天堂一区二区| 国产久卡久卡久卡久卡视频精品| 91精品国产综合久久婷婷香蕉 | 国产精品一卡二| 精品少妇一区二区三区日产乱码| 亚洲福利一区二区| 欧美影院一区二区三区| 亚洲欧美激情视频在线观看一区二区三区| 国产乱人伦精品一区二区在线观看| 69p69国产精品| 水蜜桃久久夜色精品一区的特点| 欧美三级欧美一级| 亚洲在线观看免费| 在线免费观看视频一区| 一区二区在线看| 91啪亚洲精品| 亚洲精品欧美二区三区中文字幕| 99精品视频一区二区三区| 亚洲欧洲色图综合| 91啪亚洲精品| 亚洲国产wwwccc36天堂| 欧美性猛片xxxx免费看久爱| 亚洲午夜久久久久久久久电影网 | 亚洲6080在线| 欧美日韩高清一区二区三区| 五月天精品一区二区三区| 91精品国产高清一区二区三区| 日韩精品久久理论片| 日韩一区二区麻豆国产| 国产资源在线一区| 国产午夜一区二区三区| 成人av在线播放网址| 亚洲黄色性网站| 欧美福利视频一区| 久久福利资源站| 久久九九全国免费| 99久久国产综合色|国产精品| 亚洲色图视频网| 欧美精品日韩一本| 激情深爱一区二区| 国产精品福利一区二区| 欧美午夜在线观看| 麻豆国产精品官网| 国产精品免费免费| 欧美中文字幕亚洲一区二区va在线 | 欧美日韩一二区| 精品一二线国产| 国产精品成人免费在线| 欧美日韩综合一区| 精品在线一区二区三区| 国产精品成人免费在线| 欧美乱熟臀69xxxxxx| 国产一区二区三区免费观看| 亚洲男人的天堂在线aⅴ视频| 欧美日本国产视频| 国产精品中文欧美| 亚洲国产va精品久久久不卡综合| 精品日韩99亚洲| 91网址在线看| 久久av资源网| 有坂深雪av一区二区精品| 日韩欧美亚洲另类制服综合在线| 高清在线成人网| 三级成人在线视频| 国产精品丝袜久久久久久app| 精品视频在线免费看| 国产不卡一区视频| 日韩精品久久久久久| 国产精品国产精品国产专区不蜜| 欧美绝品在线观看成人午夜影视| 成人污视频在线观看| 美女视频免费一区| 亚洲激情自拍视频| 欧美国产一区二区在线观看| 5月丁香婷婷综合| 色综合一个色综合| 国产精品888| 免费在线成人网| 亚洲国产中文字幕|