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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? netscapedraftspec.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/NetscapeDraftSpec.java,v 1.11 2004/05/13 04:02:00 mbecke Exp $ * $Revision: 480424 $ * $Date: 2006-11-29 06:56:49 +0100 (Wed, 29 Nov 2006) $ * * ==================================================================== * *  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.StringTokenizer;import java.util.Date;import java.util.Locale;   import java.text.DateFormat; import java.text.SimpleDateFormat;  import java.text.ParseException; import org.apache.commons.httpclient.HeaderElement;import org.apache.commons.httpclient.NameValuePair;import org.apache.commons.httpclient.Cookie;/** * <P>Netscape cookie draft 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 NetscapeDraftSpec extends CookieSpecBase {    /** Default constructor */    public NetscapeDraftSpec() {        super();    }    /**      * Parses the Set-Cookie value into an array of <tt>Cookie</tt>s.      *      * <p>Syntax of the Set-Cookie HTTP Response Header:</p>      *       * <p>This is the format a CGI script would use to add to       * the HTTP headers a new piece of data which is to be stored by       * the client for later retrieval.</p>      *        * <PRE>      *  Set-Cookie: NAME=VALUE; expires=DATE; path=PATH; domain=DOMAIN_NAME; secure      * </PRE>      *      * <p>Please note that Netscape draft specification does not fully       * conform to the HTTP header format. Netscape draft does not specify       * whether multiple cookies may be sent in one header. Hence, comma       * character may be present in unquoted cookie value or unquoted       * parameter value.</p>      *       * @link http://wp.netscape.com/newsref/std/cookie_spec.html      *       * @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      *       * @since 3.0      */    public Cookie[] parse(String host, int port, String path,         boolean secure, final String header)         throws MalformedCookieException {                    LOG.trace("enter NetscapeDraftSpec.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 headerelement = new HeaderElement(header.toCharArray());        Cookie cookie = new Cookie(host,                       headerelement.getName(),                       headerelement.getValue(),                       defaultPath,                        null,                       false);        // 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);            }        }        return new Cookie[] {cookie};    }    /**      * Parse the cookie attribute and update the corresponsing {@link Cookie}      * properties as defined by the Netscape draft specification      *      * @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("expires")) {            if (paramValue == null) {                throw new MalformedCookieException(                    "Missing value for expires attribute");            }            try {                DateFormat expiryFormat = new SimpleDateFormat(                    "EEE, dd-MMM-yyyy HH:mm:ss z", Locale.US);                Date date = expiryFormat.parse(paramValue);                cookie.setExpiryDate(date);            } catch (ParseException e) {                throw new MalformedCookieException("Invalid expires "                    + "attribute: " + e.getMessage());            }        } else {            super.parseAttribute(attribute, cookie);        }    }    /**     * Performs domain-match as described in the Netscape draft.     * @param host The target host.     * @param domain The cookie domain attribute.     * @return true if the specified host matches the given domain.     */    public boolean domainMatch(final String host, final String domain) {        return host.endsWith(domain);    }    /**      * Performs Netscape draft 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("enterNetscapeDraftCookieProcessor "            + "RCF2109CookieProcessor.validate(Cookie)");        // Perform generic validation        super.validate(host, port, path, secure, cookie);        // Perform Netscape Cookie draft specific validation        if (host.indexOf(".") >= 0) {            int domainParts = new StringTokenizer(cookie.getDomain(), ".")                .countTokens();            if (isSpecialDomain(cookie.getDomain())) {                if (domainParts < 2) {                    throw new MalformedCookieException("Domain attribute \""                        + cookie.getDomain()                         + "\" violates the Netscape cookie specification for "                        + "special domains");                }            } else {                if (domainParts < 3) {                    throw new MalformedCookieException("Domain attribute \""                        + cookie.getDomain()                         + "\" violates the Netscape cookie specification");                }                        }        }    }        /**     * Checks if the given domain is in one of the seven special     * top level domains defined by the Netscape cookie specification.     * @param domain The domain.     * @return True if the specified domain is "special"     */    private static boolean isSpecialDomain(final String domain) {        final String ucDomain = domain.toUpperCase();        if (ucDomain.endsWith(".COM")            || ucDomain.endsWith(".EDU")           || ucDomain.endsWith(".NET")           || ucDomain.endsWith(".GOV")           || ucDomain.endsWith(".MIL")           || ucDomain.endsWith(".ORG")           || ucDomain.endsWith(".INT")) {            return true;        }        return false;    }}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91美女在线观看| 欧美天堂亚洲电影院在线播放| 亚洲欧洲韩国日本视频| 91精品国产欧美一区二区成人| 成人av小说网| 久久成人免费网| 亚洲国产日韩av| 成人免费在线观看入口| 日韩免费性生活视频播放| 日本道色综合久久| 国产v日产∨综合v精品视频| 日韩福利视频网| 亚洲一区二区三区视频在线播放| 久久精品日产第一区二区三区高清版| 欧美日韩高清不卡| 91久久精品一区二区二区| 99久久婷婷国产综合精品| 国产伦精品一区二区三区视频青涩 | 久久久99精品久久| 欧美一级久久久| 欧美男人的天堂一二区| 色8久久人人97超碰香蕉987| 成人免费毛片a| 国产激情一区二区三区桃花岛亚洲| 日韩成人精品在线观看| 亚洲国产aⅴ天堂久久| 亚洲九九爱视频| 国产精品久久福利| 国产精品女人毛片| 亚洲国产精品国自产拍av| 久久久精品人体av艺术| 欧美成人精品3d动漫h| 日韩一级二级三级精品视频| 欧美男男青年gay1069videost| 欧美日韩免费观看一区二区三区| 91黄色免费观看| 欧美影院一区二区| 欧美日韩国产小视频| 欧美精品国产精品| 91精品国产综合久久精品麻豆| 欧美日韩国产精品成人| 精品1区2区3区| 正在播放一区二区| 日韩欧美在线影院| 精品国产一区二区精华| 国产拍欧美日韩视频二区| 国产精品你懂的| 亚洲欧美日韩久久| 五月天亚洲婷婷| 日韩不卡手机在线v区| 蜜桃视频在线一区| 国产一区二区日韩精品| 国产高清亚洲一区| 99久久久久久| 欧美伦理影视网| 日韩免费视频一区二区| 国产农村妇女精品| 亚洲蜜桃精久久久久久久| 亚洲制服丝袜av| 蜜桃精品视频在线观看| 国产一区二区三区不卡在线观看| 国产福利不卡视频| 日本道免费精品一区二区三区| 欧美日本高清视频在线观看| 精品国产一区a| 综合在线观看色| 日韩精品国产欧美| 国产91精品久久久久久久网曝门| 93久久精品日日躁夜夜躁欧美| 欧美日本不卡视频| 欧美激情资源网| 天天做天天摸天天爽国产一区| 国产一区二区三区观看| 一本久道久久综合中文字幕| 日韩欧美高清一区| 一区在线中文字幕| 青娱乐精品视频| 99r国产精品| 日韩欧美精品在线视频| 日韩毛片在线免费观看| 美女视频网站久久| 99re这里只有精品6| 欧美大片一区二区三区| 中文字幕日韩一区二区| 免费成人在线观看| 色哟哟一区二区在线观看| 日韩视频在线观看一区二区| 亚洲三级在线免费| 国产精品自拍在线| 欧美肥胖老妇做爰| 亚洲欧美一区二区三区孕妇| 久久99热99| 欧美在线视频全部完| 欧美激情在线一区二区| 日本女优在线视频一区二区| www.亚洲精品| 精品国产免费人成电影在线观看四季| 亚洲精品国产一区二区精华液| 久久爱www久久做| 欧美日韩国产中文| 亚洲另类在线制服丝袜| 国产河南妇女毛片精品久久久| 欧美一区二区三区免费在线看 | 国产精品中文字幕日韩精品| 欧美亚洲高清一区二区三区不卡| 国产亚洲成年网址在线观看| 免费成人在线播放| 欧美日韩三级一区| 夜色激情一区二区| 91污片在线观看| 国产精品乱子久久久久| 国产精品综合一区二区| 精品国产亚洲一区二区三区在线观看| 亚洲国产精品久久艾草纯爱 | 日韩一级在线观看| 亚洲成人自拍偷拍| 欧美中文一区二区三区| 亚洲免费在线观看视频| 国产91精品一区二区麻豆网站| 亚洲精品在线观看网站| 免费成人美女在线观看.| 欧美日韩精品欧美日韩精品| 亚洲精品日韩综合观看成人91| 99视频超级精品| 国产网红主播福利一区二区| 日韩精品免费视频人成| 欧美日韩亚洲综合在线| 亚洲一区二区三区在线| 欧美性一级生活| 亚洲成人黄色影院| 欧美日韩精品一区二区| 婷婷丁香久久五月婷婷| 911精品产国品一二三产区| 三级久久三级久久| 欧美一区二区三区在线看| 日韩精品电影在线| 日韩精品一区二区三区蜜臀| 9久草视频在线视频精品| 国产网站一区二区| 北岛玲一区二区三区四区| 日韩毛片视频在线看| 在线观看亚洲一区| 午夜a成v人精品| 欧美大肚乱孕交hd孕妇| 国产资源在线一区| 欧美国产成人精品| 91丨porny丨户外露出| 亚洲综合无码一区二区| 666欧美在线视频| 狠狠色丁香婷婷综合| 国产丝袜欧美中文另类| 91蜜桃在线免费视频| 亚洲国产精品影院| 日韩你懂的在线播放| 粉嫩aⅴ一区二区三区四区五区| 一区精品在线播放| 欧美日韩五月天| 狠狠色丁香婷综合久久| 中文字幕日韩一区| 欧美精品电影在线播放| 国产精品538一区二区在线| 亚洲欧洲日韩在线| 3atv在线一区二区三区| 国产乱码精品一区二区三区忘忧草 | 亚洲免费av高清| 日韩一区二区三区免费观看| 国产91在线看| 亚洲自拍另类综合| 久久久久久久综合日本| 在线一区二区观看| 久久99久久99精品免视看婷婷| 中文字幕在线一区| 欧美老肥妇做.爰bbww| 国产精品正在播放| 亚洲成人av在线电影| 久久久亚洲精品石原莉奈| 色94色欧美sute亚洲线路二| 久久国产精品一区二区| 国产精品狼人久久影院观看方式| 欧美日本视频在线| av一本久道久久综合久久鬼色| 婷婷综合久久一区二区三区| 国产日韩精品久久久| 欧美日韩高清在线| 成人不卡免费av| 麻豆久久久久久久| 一区二区欧美在线观看| 久久久精品一品道一区| 欧美日本国产一区| 97精品久久久久中文字幕| 麻豆91在线播放免费| 一区二区高清视频在线观看| 久久无码av三级| 欧美日韩aaaaa| 色网站国产精品| 国产成人av电影免费在线观看| 日韩av一二三| 亚洲专区一二三| 亚洲人成网站在线| 久久精品一区二区三区四区|