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

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

?? rfc2109spec.java

?? Light in the box 抓取程序。 使用HttpClient
?? JAVA
字號:
/* * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//httpclient/src/java/org/apache/commons/httpclient/cookie/RFC2109Spec.java,v 1.21 2004/06/05 16:49:20 olegk Exp $ * $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 org.apache.commons.httpclient.NameValuePair;import org.apache.commons.httpclient.Cookie;import org.apache.commons.httpclient.util.ParameterFormatter;/** * <p>RFC 2109 specific cookie management functions * * @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 RFC2109Spec extends CookieSpecBase {    private final ParameterFormatter formatter;    /**     * Cookie Response Header  name for cookies processed     * by this spec.     */    public final static String SET_COOKIE_KEY = "set-cookie";    /** Default constructor */    public RFC2109Spec() {        super();        this.formatter = new ParameterFormatter();        this.formatter.setAlwaysUseQuotes(true);    }    /**      * Parse RFC 2109 specific cookie attribute and update the corresponsing      * {@link Cookie} properties.      *      * @param attribute {@link NameValuePair} 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();        final String paramValue = attribute.getValue();        if (paramName.equals("path")) {            if (paramValue == null) {                throw new MalformedCookieException(                    "Missing value for path attribute");            }            if (paramValue.trim().equals("")) {                throw new MalformedCookieException(                    "Blank value for path attribute");            }            cookie.setPath(paramValue);            cookie.setPathAttributeSpecified(true);        } else if (paramName.equals("version")) {            if (paramValue == null) {                throw new MalformedCookieException(                    "Missing value for version attribute");            }            try {               cookie.setVersion(Integer.parseInt(paramValue));            } catch (NumberFormatException e) {                throw new MalformedCookieException("Invalid version: "                     + e.getMessage());            }        } else {            super.parseAttribute(attribute, cookie);        }    }    /**      * Performs RFC 2109 compliant {@link Cookie} validation      *      * @param host the host from which the {@link Cookie} was received      * @param port the port from which the {@link Cookie} was received      * @param path the path from which the {@link Cookie} was received      * @param secure <tt>true</tt> when the {@link Cookie} was received using a      * secure connection      * @param cookie The cookie to validate      * @throws MalformedCookieException if an exception occurs during      * validation      */    public void validate(String host, int port, String path,         boolean secure, final Cookie cookie) throws MalformedCookieException {                    LOG.trace("enter RFC2109Spec.validate(String, int, String, "            + "boolean, Cookie)");                    // Perform generic validation        super.validate(host, port, path, secure, cookie);        // Perform RFC 2109 specific validation                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 $");        }                if (cookie.isDomainAttributeSpecified()             && (!cookie.getDomain().equals(host))) {                            // domain must start with dot            if (!cookie.getDomain().startsWith(".")) {                throw new MalformedCookieException("Domain attribute \""                     + cookie.getDomain()                     + "\" violates RFC 2109: domain must start with a dot");            }            // domain must have at least one embedded dot            int dotIndex = cookie.getDomain().indexOf('.', 1);            if (dotIndex < 0 || dotIndex == cookie.getDomain().length() - 1) {                throw new MalformedCookieException("Domain attribute \""                     + cookie.getDomain()                     + "\" violates RFC 2109: domain must contain an embedded dot");            }            host = host.toLowerCase();            if (!host.endsWith(cookie.getDomain())) {                throw new MalformedCookieException(                    "Illegal domain attribute \"" + cookie.getDomain()                     + "\". Domain of origin: \"" + host + "\"");            }            // host minus domain may not contain any dots            String hostWithoutDomain = host.substring(0, host.length()                 - cookie.getDomain().length());            if (hostWithoutDomain.indexOf('.') != -1) {                throw new MalformedCookieException("Domain attribute \""                     + cookie.getDomain()                     + "\" violates RFC 2109: host minus domain may not contain any dots");            }        }    }    /**     * Performs domain-match as defined by the RFC2109.     * @param host The target host.     * @param domain The cookie domain attribute.     * @return true if the specified host matches the given domain.     *      * @since 3.0     */    public boolean domainMatch(String host, String domain) {        boolean match = host.equals(domain)             || (domain.startsWith(".") && host.endsWith(domain));        return match;    }    /**     * Return a name/value string suitable for sending in a <tt>"Cookie"</tt>     * header as defined in RFC 2109 for backward compatibility with cookie     * version 0     * @param buffer The string buffer to use for output     * @param param The parameter.     * @param version The cookie version      */    private void formatParam(final StringBuffer buffer, final NameValuePair param, int version) {        if (version < 1) {            buffer.append(param.getName());            buffer.append("=");            if (param.getValue() != null) {                buffer.append(param.getValue());               }        } else {            this.formatter.format(buffer, param);        }    }    /**     * Return a string suitable for sending in a <tt>"Cookie"</tt> header      * as defined in RFC 2109 for backward compatibility with cookie version 0     * @param buffer The string buffer to use for output     * @param cookie The {@link Cookie} to be formatted as string     * @param version The version to use.     */    private void formatCookieAsVer(final StringBuffer buffer, final Cookie cookie, int version) {        String value = cookie.getValue();        if (value == null) {            value = "";        }        formatParam(buffer, new NameValuePair(cookie.getName(), value), version);        if ((cookie.getPath() != null) && cookie.isPathAttributeSpecified()) {          buffer.append("; ");          formatParam(buffer, new NameValuePair("$Path", cookie.getPath()), version);        }        if ((cookie.getDomain() != null)             && cookie.isDomainAttributeSpecified()) {            buffer.append("; ");            formatParam(buffer, new NameValuePair("$Domain", cookie.getDomain()), version);        }    }    /**     * Return a string suitable for sending in a <tt>"Cookie"</tt> header as     * defined in RFC 2109     * @param cookie a {@link Cookie} to be formatted as string     * @return a string suitable for sending in a <tt>"Cookie"</tt> header.     */    public String formatCookie(Cookie cookie) {        LOG.trace("enter RFC2109Spec.formatCookie(Cookie)");        if (cookie == null) {            throw new IllegalArgumentException("Cookie may not be null");        }        int version = cookie.getVersion();        StringBuffer buffer = new StringBuffer();        formatParam(buffer,                 new NameValuePair("$Version", Integer.toString(version)),                 version);        buffer.append("; ");        formatCookieAsVer(buffer, cookie, version);        return buffer.toString();    }    /**     * Create a RFC 2109 compliant <tt>"Cookie"</tt> header value containing all     * {@link Cookie}s in <i>cookies</i> suitable for sending in a <tt>"Cookie"     * </tt> header     * @param cookies an array of {@link Cookie}s to be formatted     * @return a string suitable for sending in a Cookie header.     */    public String formatCookies(Cookie[] cookies) {        LOG.trace("enter RFC2109Spec.formatCookieHeader(Cookie[])");        int version = Integer.MAX_VALUE;        // Pick the lowerest common denominator        for (int i = 0; i < cookies.length; i++) {            Cookie cookie = cookies[i];            if (cookie.getVersion() < version) {                version = cookie.getVersion();            }        }        final StringBuffer buffer = new StringBuffer();        formatParam(buffer,                 new NameValuePair("$Version", Integer.toString(version)),                 version);        for (int i = 0; i < cookies.length; i++) {            buffer.append("; ");            formatCookieAsVer(buffer, cookies[i], version);        }        return buffer.toString();    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲aⅴ怡春院| 一区二区三区免费看视频| 91福利视频久久久久| 99久久久无码国产精品| 成人国产亚洲欧美成人综合网| 激情图区综合网| 国产中文一区二区三区| 国产美女av一区二区三区| 国产成人8x视频一区二区| 懂色av一区二区三区免费看| 粉嫩高潮美女一区二区三区| 成人黄色小视频| 色悠久久久久综合欧美99| 色国产精品一区在线观看| 欧美在线一区二区| 日韩欧美国产综合在线一区二区三区| 3d动漫精品啪啪一区二区竹菊| 日韩一区二区在线播放| 精品久久五月天| 国产精品欧美极品| 亚洲成av人片一区二区| 麻豆91免费观看| 岛国精品在线播放| 欧美性猛交xxxxxxxx| 欧美变态tickling挠脚心| 国产精品视频一二三| 一区二区三区日韩在线观看| 免费成人在线播放| 大胆欧美人体老妇| 欧美精品在线观看播放| 日韩写真欧美这视频| 国产日韩欧美亚洲| 午夜视频在线观看一区二区| 国产伦精品一区二区三区在线观看 | 国产精品久久久久久久久图文区| 亚洲视频一二三区| 老司机精品视频一区二区三区| 成人高清视频免费观看| 欧美疯狂做受xxxx富婆| 国产精品色呦呦| 免费欧美在线视频| 欧美性感一区二区三区| 国产女人18水真多18精品一级做 | 亚洲香肠在线观看| 国产一区二区免费看| 欧美高清dvd| 亚洲同性同志一二三专区| 韩国理伦片一区二区三区在线播放 | 麻豆91精品91久久久的内涵| 91麻豆成人久久精品二区三区| 欧美一区永久视频免费观看| 自拍av一区二区三区| 国产综合久久久久影院| 欧美日韩一区二区三区四区五区| 国产女主播一区| 九一九一国产精品| 91精品国产品国语在线不卡| 亚洲色图都市小说| 成人一区二区三区| 精品国产乱码久久久久久蜜臀 | 国产精品国产自产拍在线| 免费在线一区观看| 欧美四级电影在线观看| 国产午夜精品理论片a级大结局| 蜜臀av一区二区在线免费观看| 欧美亚洲综合另类| 亚洲欧美日韩一区二区三区在线观看| 国产一区二区免费视频| 精品1区2区在线观看| 老司机午夜精品99久久| 69堂成人精品免费视频| 亚洲成人中文在线| 欧美视频一区二区三区四区| 亚洲欧美国产高清| 91老师片黄在线观看| 国产精品久久久久一区二区三区| 国产精品一二三四区| 精品日产卡一卡二卡麻豆| 视频一区二区不卡| 日韩一区二区在线播放| 看片的网站亚洲| 欧美精品一区二区蜜臀亚洲| 国产一区二区三区久久久| 久久综合久久久久88| 国产91丝袜在线18| 成人欧美一区二区三区1314| 一本一道久久a久久精品| 亚洲精品日韩综合观看成人91| 91福利在线播放| 日韩精品视频网| 国产日韩欧美精品在线| 91同城在线观看| 午夜视频在线观看一区二区| 精品国产乱码久久久久久久久| 国产麻豆欧美日韩一区| 亚洲欧美成人一区二区三区| 欧美手机在线视频| 看片网站欧美日韩| 国产精品不卡在线| 欧美理论片在线| 国产毛片精品一区| 一区二区三区在线视频免费 | 欧美成人精品二区三区99精品| 国产一区在线观看视频| 日韩美女视频19| 日韩免费性生活视频播放| 丰满放荡岳乱妇91ww| 亚洲国产乱码最新视频| 亚洲精品在线观看网站| 波多野结衣一区二区三区| 亚洲福利视频一区| 国产日韩在线不卡| 欧美精品在线观看一区二区| 粉嫩av一区二区三区在线播放| 一区二区国产视频| 国产午夜精品一区二区三区嫩草| 在线这里只有精品| 国产suv精品一区二区6| 丝袜脚交一区二区| 国产精品久久久久久久岛一牛影视| 欧美日韩在线直播| 成人一区二区视频| 日韩精彩视频在线观看| 日韩理论片一区二区| 精品精品国产高清a毛片牛牛 | 亚洲欧美自拍偷拍色图| 日韩欧美国产三级| 欧美私模裸体表演在线观看| 成人国产免费视频| 国内精品久久久久影院薰衣草| 五月天网站亚洲| 一区二区三区欧美日| 国产亚洲欧美中文| 欧美大片一区二区| 在线观看91av| 在线亚洲免费视频| 日本精品视频一区二区| www.亚洲免费av| 国产乱色国产精品免费视频| 日韩精品一级中文字幕精品视频免费观看 | 91视视频在线直接观看在线看网页在线看| 久久精品国产精品亚洲精品| 亚洲一本大道在线| 亚洲六月丁香色婷婷综合久久| 欧美激情综合五月色丁香小说| 精品三级在线观看| 日韩欧美国产1| 日韩亚洲电影在线| 日韩欧美精品在线视频| 日韩写真欧美这视频| 欧美高清www午色夜在线视频| 欧美日韩国产一级片| 在线观看三级视频欧美| 色综合一区二区三区| 91麻豆国产精品久久| 91久久精品国产91性色tv| 色婷婷精品久久二区二区蜜臂av| 色哟哟欧美精品| 欧美体内she精高潮| 欧美精品黑人性xxxx| 91麻豆精品国产91久久久久久| 欧美美女喷水视频| 欧美大片日本大片免费观看| 久久色视频免费观看| 欧美极品少妇xxxxⅹ高跟鞋| 国产精品无遮挡| 亚洲欧美日本韩国| 亚洲成人综合在线| 美国毛片一区二区| 国产精品正在播放| 99在线热播精品免费| 欧洲精品在线观看| 欧美一卡二卡在线观看| 国产日产精品1区| 亚洲综合色视频| 美腿丝袜一区二区三区| 国产精品自拍一区| av在线这里只有精品| 欧美电影在哪看比较好| 久久亚洲免费视频| 亚洲精品高清在线观看| 日韩激情中文字幕| 成人自拍视频在线观看| 在线观看国产一区二区| 精品国产制服丝袜高跟| 亚洲欧洲av在线| 美女一区二区视频| 99久久久久免费精品国产| 在线电影国产精品| 欧美国产精品中文字幕| 午夜精品一区在线观看| 国产福利一区二区| 欧美日韩国产精选| 国产精品美女久久久久久久网站| 性做久久久久久久久| 国产精品一二三区在线| 91精品国模一区二区三区| 国产精品免费视频网站| 日本美女视频一区二区| 色诱亚洲精品久久久久久|