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

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

?? rfc2965spec.java

?? Light in the box 抓取程序。 使用HttpClient
?? JAVA
?? 第 1 頁 / 共 3 頁
字號:
/* * $HeadURL: https://svn.apache.org/repos/asf/jakarta/httpcomponents/oac.hc3x/tags/HTTPCLIENT_3_1/src/java/org/apache/commons/httpclient/cookie/RFC2965Spec.java $ * $Revision: 507134 $ * $Date: 2007-02-13 19:18:05 +0100 (Tue, 13 Feb 2007) $ *  * ==================================================================== * *  Licensed to the Apache Software Foundation (ASF) under one or more *  contributor license agreements.  See the NOTICE file distributed with *  this work for additional information regarding copyright ownership. *  The ASF licenses this file to You 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.ArrayList;import java.util.Arrays;import java.util.Comparator;import java.util.Date;import java.util.HashMap;import java.util.Iterator;import java.util.LinkedList;import java.util.List;import java.util.Map;import java.util.StringTokenizer;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.ParameterFormatter;/** * <p>RFC 2965 specific cookie management functions.</p> *  * @author jain.samit@gmail.com (Samit Jain) * * @since 3.1 */public class RFC2965Spec extends CookieSpecBase implements CookieVersionSupport {    private static final Comparator PATH_COMPOARATOR = new CookiePathComparator();        /**    * Cookie Response Header  name for cookies processed    * by this spec.    */    public final static String SET_COOKIE2_KEY = "set-cookie2";        /**    * used for formatting RFC 2956 style cookies    */    private final ParameterFormatter formatter;         /**     * Stores the list of attribute handlers     */    private final List attribHandlerList;        /**    * Stores attribute name -> attribute handler mappings    */    private final Map attribHandlerMap;    /**     * Fallback cookie spec (RFC 2109)     */    private final CookieSpec rfc2109;        /**      * Default constructor      * */    public RFC2965Spec() {        super();        this.formatter = new ParameterFormatter();        this.formatter.setAlwaysUseQuotes(true);        this.attribHandlerMap = new HashMap(10);                this.attribHandlerList = new ArrayList(10);        this.rfc2109 = new RFC2109Spec();                registerAttribHandler(Cookie2.PATH, new Cookie2PathAttributeHandler());        registerAttribHandler(Cookie2.DOMAIN, new Cookie2DomainAttributeHandler());        registerAttribHandler(Cookie2.PORT, new Cookie2PortAttributeHandler());        registerAttribHandler(Cookie2.MAXAGE, new Cookie2MaxageAttributeHandler());        registerAttribHandler(Cookie2.SECURE, new CookieSecureAttributeHandler());        registerAttribHandler(Cookie2.COMMENT, new CookieCommentAttributeHandler());        registerAttribHandler(Cookie2.COMMENTURL, new CookieCommentUrlAttributeHandler());        registerAttribHandler(Cookie2.DISCARD, new CookieDiscardAttributeHandler());        registerAttribHandler(Cookie2.VERSION, new Cookie2VersionAttributeHandler());    }    protected void registerAttribHandler(            final String name, final CookieAttributeHandler handler) {        if (name == null) {            throw new IllegalArgumentException("Attribute name may not be null");        }        if (handler == null) {            throw new IllegalArgumentException("Attribute handler may not be null");        }        if (!this.attribHandlerList.contains(handler)) {            this.attribHandlerList.add(handler);        }        this.attribHandlerMap.put(name, handler);    }        /**     * Finds an attribute handler {@link CookieAttributeHandler} for the     * given attribute. Returns <tt>null</tt> if no attribute handler is     * found for the specified attribute.     *     * @param name attribute name. e.g. Domain, Path, etc.     * @return an attribute handler or <tt>null</tt>     */    protected CookieAttributeHandler findAttribHandler(final String name) {        return (CookieAttributeHandler) this.attribHandlerMap.get(name);    }        /**     * Gets attribute handler {@link CookieAttributeHandler} for the     * given attribute.     *     * @param name attribute name. e.g. Domain, Path, etc.     * @throws IllegalStateException if handler not found for the     *          specified attribute.     */    protected CookieAttributeHandler getAttribHandler(final String name) {        CookieAttributeHandler handler = findAttribHandler(name);        if (handler == null) {            throw new IllegalStateException("Handler not registered for " +                                            name + " attribute.");        } else {            return handler;        }    }    protected Iterator getAttribHandlerIterator() {        return this.attribHandlerList.iterator();    }        /**     * Parses the Set-Cookie2 value into an array of <tt>Cookie</tt>s.     *     * <P>The syntax for the Set-Cookie2 response header is:     *     * <PRE>     * set-cookie      =    "Set-Cookie2:" cookies     * cookies         =    1#cookie     * cookie          =    NAME "=" VALUE * (";" cookie-av)     * NAME            =    attr     * VALUE           =    value     * cookie-av       =    "Comment" "=" value     *                 |    "CommentURL" "=" <"> http_URL <">     *                 |    "Discard"     *                 |    "Domain" "=" value     *                 |    "Max-Age" "=" value     *                 |    "Path" "=" value     *                 |    "Port" [ "=" <"> portlist <"> ]     *                 |    "Secure"     *                 |    "Version" "=" 1*DIGIT     * portlist        =       1#portnum     * portnum         =       1*DIGIT     * </PRE>     *     * @param host the host from which the <tt>Set-Cookie2</tt> value was     * received     * @param port the port from which the <tt>Set-Cookie2</tt> value was     * received     * @param path the path from which the <tt>Set-Cookie2</tt> value was     * received     * @param secure <tt>true</tt> when the <tt>Set-Cookie2</tt> value was     * received over secure conection     * @param header the <tt>Set-Cookie2</tt> <tt>Header</tt> received from the server     * @return an array of <tt>Cookie</tt>s parsed from the Set-Cookie2 value     * @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 RFC2965.parse("                  + "String, int, String, boolean, Header)");        if (header == null) {            throw new IllegalArgumentException("Header may not be null.");        }        if (header.getName() == null) {            throw new IllegalArgumentException("Header name may not be null.");        }        if (header.getName().equalsIgnoreCase(SET_COOKIE2_KEY)) {            // parse cookie2 cookies            return parse(host, port, path, secure, header.getValue());        } else if (header.getName().equalsIgnoreCase(RFC2109Spec.SET_COOKIE_KEY)) {            // delegate parsing of old-style cookies to rfc2109Spec            return this.rfc2109.parse(host, port, path, secure, header.getValue());        } else {            throw new MalformedCookieException("Header name is not valid. " +                                               "RFC 2965 supports \"set-cookie\" " +                                               "and \"set-cookie2\" headers.");        }    }    /**     * @see #parse(String, int, String, boolean, org.apache.commons.httpclient.Header)     */    public Cookie[] parse(String host, int port, String path,                          boolean secure, final String header)            throws MalformedCookieException {        LOG.trace("enter RFC2965Spec.parse("                  + "String, int, String, boolean, String)");        // before we do anything, lets check validity of arguments        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 = getEffectiveHost(host);        HeaderElement[] headerElements =                HeaderElement.parseElements(header.toCharArray());        List cookies = new LinkedList();        for (int i = 0; i < headerElements.length; i++) {            HeaderElement headerelement = headerElements[i];            Cookie2 cookie = null;            try {                cookie = new Cookie2(host,                                    headerelement.getName(),                                    headerelement.getValue(),                                    path,                                    null,                                    false,                                    new int[] {port});            } catch (IllegalArgumentException ex) {                throw new MalformedCookieException(ex.getMessage());            }            NameValuePair[] parameters = headerelement.getParameters();            // could be null. In case only a header element and no parameters.            if (parameters != null) {                // Eliminate duplicate attribues. The first occurence takes precedence                Map attribmap = new HashMap(parameters.length);                 for (int j = parameters.length - 1; j >= 0; j--) {                    NameValuePair param = parameters[j];                    attribmap.put(param.getName().toLowerCase(), param);                }                for (Iterator it = attribmap.entrySet().iterator(); it.hasNext(); ) {                    Map.Entry entry = (Map.Entry) it.next();                    parseAttribute((NameValuePair) entry.getValue(), cookie);                }            }            cookies.add(cookie);            // cycle through the parameters        }        return (Cookie[]) cookies.toArray(new Cookie[cookies.size()]);    }    /**     * Parse RFC 2965 specific cookie attribute and update the corresponsing     * {@link org.apache.commons.httpclient.Cookie} properties.     *     * @param attribute {@link org.apache.commons.httpclient.NameValuePair} cookie attribute from the     * <tt>Set-Cookie2</tt> header.     * @param cookie {@link org.apache.commons.httpclient.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 (attribute.getName() == null) {            throw new IllegalArgumentException("Attribute Name may not be null.");        }        if (cookie == null) {            throw new IllegalArgumentException("Cookie may not be null.");        }        final String paramName = attribute.getName().toLowerCase();        final String paramValue = attribute.getValue();        CookieAttributeHandler handler = findAttribHandler(paramName);        if (handler == null) {            // ignore unknown attribute-value pairs            if (LOG.isDebugEnabled())                LOG.debug("Unrecognized cookie attribute: " +                          attribute.toString());        } else {            handler.parse(cookie, paramValue);        }    }    /**     * Performs RFC 2965 compliant {@link org.apache.commons.httpclient.Cookie} validation     *     * @param host the host from which the {@link org.apache.commons.httpclient.Cookie} was received     * @param port the port from which the {@link org.apache.commons.httpclient.Cookie} was received     * @param path the path from which the {@link org.apache.commons.httpclient.Cookie} was received     * @param secure <tt>true</tt> when the {@link org.apache.commons.httpclient.Cookie} was received using a     * secure connection     * @param cookie The cookie to validate     * @throws MalformedCookieException if an exception occurs during     * validation     */    public void validate(final String host, int port, final String path,                         boolean secure, final Cookie cookie)            throws MalformedCookieException {        LOG.trace("enter RFC2965Spec.validate(String, int, String, "                  + "boolean, Cookie)");        if (cookie instanceof Cookie2) {            if (cookie.getName().indexOf(' ') != -1) {                throw new MalformedCookieException("Cookie name may not contain blanks");            }            if (cookie.getName().startsWith("$")) {                throw new MalformedCookieException("Cookie name may not start with $");            }            CookieOrigin origin = new CookieOrigin(getEffectiveHost(host), port, path, secure);             for (Iterator i = getAttribHandlerIterator(); i.hasNext(); ) {              CookieAttributeHandler handler = (CookieAttributeHandler) i.next();              handler.validate(cookie, origin);            }        } else {            // old-style cookies are validated according to the old rules            this.rfc2109.validate(host, port, path, secure, cookie);        }    }    /**     * Return <tt>true</tt> if the cookie should be submitted with a request     * with given attributes, <tt>false</tt> otherwise.     * @param host the host to which the request is being submitted     * @param port the port to which the request is being submitted (ignored)     * @param path the path to which the request is being submitted     * @param secure <tt>true</tt> if the request is using a secure connection     * @return true if the cookie matches the criterium     */    public boolean match(String host, int port, String path,                         boolean secure, final Cookie cookie) {

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲午夜av在线| 一区二区三区欧美在线观看| 日本一区二区三区国色天香| 欧美一区三区二区| 日韩一级片在线播放| 久久精品一区二区三区不卡| 亚洲欧美区自拍先锋| 调教+趴+乳夹+国产+精品| 看片网站欧美日韩| 91污在线观看| 久久午夜电影网| 亚洲日本一区二区| 亚洲国产视频a| 黑人巨大精品欧美一区| 91日韩一区二区三区| 精品国产污污免费网站入口 | 国产调教视频一区| 国产精品精品国产色婷婷| 污片在线观看一区二区| 成人福利视频网站| 日韩免费在线观看| 洋洋av久久久久久久一区| 极品美女销魂一区二区三区 | 国产午夜亚洲精品午夜鲁丝片| 中文字幕综合网| 国产主播一区二区| 9191精品国产综合久久久久久| 国产精品国产三级国产有无不卡 | 69久久99精品久久久久婷婷| 亚洲免费视频中文字幕| 国产成人免费视频一区| 欧美一级日韩一级| 亚洲视频在线观看一区| 黄页视频在线91| 欧美日韩一区二区三区高清| 亚洲免费视频中文字幕| 成人免费的视频| 久久久国产午夜精品| 国产精品久久久久影院色老大| 久久99久久99小草精品免视看| 日韩欧美一区二区久久婷婷| 狠狠色综合日日| 欧美激情一二三区| 91尤物视频在线观看| 亚洲自拍都市欧美小说| 7777精品伊人久久久大香线蕉最新版| 日韩高清不卡一区二区| 日韩欧美国产小视频| 国产乱人伦偷精品视频免下载| 中文在线免费一区三区高中清不卡| 成人的网站免费观看| 亚洲制服丝袜一区| 日韩午夜av一区| 成人免费视频app| 一区二区免费视频| 日韩免费观看高清完整版在线观看| 国产在线精品一区二区不卡了 | 国产精品 欧美精品| 国产精品成人一区二区艾草| 91国偷自产一区二区开放时间| 亚洲午夜影视影院在线观看| 欧美电视剧免费观看| 国产91对白在线观看九色| 亚洲欧美区自拍先锋| 欧美精品1区2区3区| 国产精品一区二区三区四区| 国产精品久久久久精k8| 欧美日韩夫妻久久| 国产高清在线精品| 亚洲一区二区欧美激情| 日韩精品专区在线| 日本二三区不卡| 国内精品久久久久影院薰衣草| 亚洲免费在线播放| 久久婷婷国产综合精品青草| 在线观看av不卡| 国产精品正在播放| 亚洲美女免费在线| 欧美大片日本大片免费观看| 99久久精品一区二区| 蜜桃视频在线一区| 亚洲激情成人在线| 久久综合久久久久88| 欧美色窝79yyyycom| 国产成a人亚洲精品| 午夜不卡av免费| 国产精品美女久久久久aⅴ国产馆| 欧美性猛片aaaaaaa做受| 激情五月婷婷综合| 亚洲va韩国va欧美va精品| 久久久国产一区二区三区四区小说| 在线观看中文字幕不卡| 国产一区二区三区在线观看免费 | 蜜臀精品久久久久久蜜臀| 亚洲日本中文字幕区| 国产亚洲精品精华液| 欧美精品tushy高清| 色女孩综合影院| 成人综合在线观看| 国产高清久久久久| 久久99久久精品| 99精品视频一区| 国产在线一区观看| 日韩国产欧美在线视频| 亚洲自拍偷拍综合| 亚洲欧美成人一区二区三区| 久久精品一区二区三区不卡 | 天堂va蜜桃一区二区三区 | 99久久久无码国产精品| 国产不卡视频在线播放| 久久国内精品自在自线400部| 亚洲第一成年网| 一区二区三区四区在线| 亚洲欧美日韩在线不卡| 国产精品的网站| 国产精品三级视频| 国产人成一区二区三区影院| 久久久.com| 久久蜜臀精品av| 久久久久高清精品| 国产偷国产偷精品高清尤物| 欧美精品一区二区三区高清aⅴ| 555夜色666亚洲国产免| 欧美日韩精品免费| 91精品国产色综合久久不卡电影| 色八戒一区二区三区| 欧洲亚洲精品在线| 欧美视频一区二区三区四区| 欧美日韩一区二区欧美激情| 欧美日韩国产综合久久| 制服丝袜亚洲播放| 欧美videofree性高清杂交| 久久综合久久久久88| 久久伊人蜜桃av一区二区| 国产午夜亚洲精品理论片色戒| 国产女同互慰高潮91漫画| 国产精品黄色在线观看| 一区二区三区欧美在线观看| 五月婷婷另类国产| 久久精品国产99久久6| 国产精品18久久久久| 99久久精品费精品国产一区二区| 91豆麻精品91久久久久久| 欧美日韩一二三区| 欧美mv日韩mv国产网站app| 久久久精品日韩欧美| 亚洲丝袜精品丝袜在线| 亚洲成人av资源| 国产美女精品一区二区三区| 97久久超碰国产精品| 欧美一区二区三区免费在线看| 精品99999| 亚洲午夜精品网| 黄色小说综合网站| 欧美在线高清视频| 欧美大片顶级少妇| 亚洲欧美电影院| 免费亚洲电影在线| 色婷婷亚洲综合| 精品久久人人做人人爰| 综合久久给合久久狠狠狠97色 | 欧美日韩综合在线免费观看| 日韩欧美视频一区| 亚洲欧洲日韩一区二区三区| 视频一区免费在线观看| 国产99一区视频免费| 欧美日韩日日骚| 国产精品黄色在线观看| 免费观看在线色综合| 91麻豆国产自产在线观看| 欧美哺乳videos| 亚洲国产精品一区二区久久恐怖片| 国产一区二区三区黄视频 | 国产成都精品91一区二区三| 欧美日韩久久一区| 亚洲欧美日韩国产一区二区三区| 免费在线观看日韩欧美| 色94色欧美sute亚洲线路二| 久久蜜桃一区二区| 美女一区二区在线观看| 欧美三级电影一区| 亚洲欧美日本韩国| 国产不卡在线一区| 337p日本欧洲亚洲大胆精品| 日本亚洲视频在线| 91国产精品成人| ㊣最新国产の精品bt伙计久久| 黄色日韩网站视频| 日韩一区二区三区在线| 亚洲国产精品久久不卡毛片| 91在线视频18| 国产日韩欧美精品综合| 狠狠色丁香九九婷婷综合五月| 91精品免费在线| 日韩在线一区二区| 欧美日韩国产一级二级| 亚洲国产欧美在线| 91福利视频久久久久| 亚洲图片欧美色图| 在线成人小视频|