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

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

?? httpmethoddirector.java

?? Light in the box 抓取程序。 使用HttpClient
?? JAVA
?? 第 1 頁 / 共 3 頁
字號:
/* * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//httpclient/src/java/org/apache/commons/httpclient/HttpMethodDirector.java,v 1.34 2005/01/14 19:40:39 olegk Exp $ * $Revision: 486658 $ * $Date: 2006-12-13 15:05:50 +0100 (Wed, 13 Dec 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;import java.io.IOException;import java.util.Collection;import java.util.HashSet;import java.util.Iterator;import java.util.Map;import java.util.Set;import org.apache.commons.httpclient.auth.AuthChallengeException;import org.apache.commons.httpclient.auth.AuthChallengeParser;import org.apache.commons.httpclient.auth.AuthChallengeProcessor;import org.apache.commons.httpclient.auth.AuthScheme;import org.apache.commons.httpclient.auth.AuthState;import org.apache.commons.httpclient.auth.AuthenticationException;import org.apache.commons.httpclient.auth.CredentialsProvider;import org.apache.commons.httpclient.auth.CredentialsNotAvailableException;import org.apache.commons.httpclient.auth.AuthScope;import org.apache.commons.httpclient.auth.MalformedChallengeException;import org.apache.commons.httpclient.params.HostParams;import org.apache.commons.httpclient.params.HttpClientParams;import org.apache.commons.httpclient.params.HttpConnectionParams;import org.apache.commons.httpclient.params.HttpMethodParams;import org.apache.commons.httpclient.params.HttpParams;import org.apache.commons.logging.Log;import org.apache.commons.logging.LogFactory;/** * Handles the process of executing a method including authentication, redirection and retries. *  * @since 3.0 */class HttpMethodDirector {    /** The www authenticate challange header. */    public static final String WWW_AUTH_CHALLENGE = "WWW-Authenticate";    /** The www authenticate response header. */    public static final String WWW_AUTH_RESP = "Authorization";    /** The proxy authenticate challange header. */    public static final String PROXY_AUTH_CHALLENGE = "Proxy-Authenticate";    /** The proxy authenticate response header. */    public static final String PROXY_AUTH_RESP = "Proxy-Authorization";    private static final Log LOG = LogFactory.getLog(HttpMethodDirector.class);    private ConnectMethod connectMethod;        private HttpState state;        private HostConfiguration hostConfiguration;        private HttpConnectionManager connectionManager;        private HttpClientParams params;        private HttpConnection conn;        /** A flag to indicate if the connection should be released after the method is executed. */    private boolean releaseConnection = false;    /** Authentication processor */    private AuthChallengeProcessor authProcessor = null;    private Set redirectLocations = null;         public HttpMethodDirector(        final HttpConnectionManager connectionManager,        final HostConfiguration hostConfiguration,        final HttpClientParams params,        final HttpState state    ) {        super();        this.connectionManager = connectionManager;        this.hostConfiguration = hostConfiguration;        this.params = params;        this.state = state;        this.authProcessor = new AuthChallengeProcessor(this.params);    }            /**     * Executes the method associated with this method director.     *      * @throws IOException     * @throws HttpException     */    public void executeMethod(final HttpMethod method) throws IOException, HttpException {        if (method == null) {            throw new IllegalArgumentException("Method may not be null");        }        // Link all parameter collections to form the hierarchy:        // Global -> HttpClient -> HostConfiguration -> HttpMethod        this.hostConfiguration.getParams().setDefaults(this.params);        method.getParams().setDefaults(this.hostConfiguration.getParams());                // Generate default request headers        Collection defaults = (Collection)this.hostConfiguration.getParams().            getParameter(HostParams.DEFAULT_HEADERS);        if (defaults != null) {            Iterator i = defaults.iterator();            while (i.hasNext()) {                method.addRequestHeader((Header)i.next());            }        }                try {            int maxRedirects = this.params.getIntParameter(HttpClientParams.MAX_REDIRECTS, 100);            for (int redirectCount = 0;;) {                // make sure the connection we have is appropriate                if (this.conn != null && !hostConfiguration.hostEquals(this.conn)) {                    this.conn.setLocked(false);                    this.conn.releaseConnection();                    this.conn = null;                }                        // get a connection, if we need one                if (this.conn == null) {                    this.conn = connectionManager.getConnectionWithTimeout(                        hostConfiguration,                        this.params.getConnectionManagerTimeout()                     );                    this.conn.setLocked(true);                    if (this.params.isAuthenticationPreemptive()                     || this.state.isAuthenticationPreemptive())                     {                        LOG.debug("Preemptively sending default basic credentials");                        method.getHostAuthState().setPreemptive();                        method.getHostAuthState().setAuthAttempted(true);                        if (this.conn.isProxied() && !this.conn.isSecure()) {                            method.getProxyAuthState().setPreemptive();                            method.getProxyAuthState().setAuthAttempted(true);                        }                    }                }                authenticate(method);                executeWithRetry(method);                if (this.connectMethod != null) {                    fakeResponse(method);                    break;                }                                boolean retry = false;                if (isRedirectNeeded(method)) {                    if (processRedirectResponse(method)) {                        retry = true;                        ++redirectCount;                        if (redirectCount >= maxRedirects) {                            LOG.error("Narrowly avoided an infinite loop in execute");                            throw new RedirectException("Maximum redirects ("                                + maxRedirects + ") exceeded");                        }                        if (LOG.isDebugEnabled()) {                            LOG.debug("Execute redirect " + redirectCount + " of " + maxRedirects);                        }                    }                }                if (isAuthenticationNeeded(method)) {                    if (processAuthenticationResponse(method)) {                        LOG.debug("Retry authentication");                        retry = true;                    }                }                if (!retry) {                    break;                }                // retry - close previous stream.  Caution - this causes                // responseBodyConsumed to be called, which may also close the                // connection.                if (method.getResponseBodyAsStream() != null) {                    method.getResponseBodyAsStream().close();                }            } //end of retry loop        } finally {            if (this.conn != null) {                this.conn.setLocked(false);            }            // If the response has been fully processed, return the connection            // to the pool.  Use this flag, rather than other tests (like            // responseStream == null), as subclasses, might reset the stream,            // for example, reading the entire response into a file and then            // setting the file as the stream.            if (                (releaseConnection || method.getResponseBodyAsStream() == null)                 && this.conn != null            ) {                this.conn.releaseConnection();            }        }    }        private void authenticate(final HttpMethod method) {        try {            if (this.conn.isProxied() && !this.conn.isSecure()) {                authenticateProxy(method);            }            authenticateHost(method);        } catch (AuthenticationException e) {            LOG.error(e.getMessage(), e);        }    }    private boolean cleanAuthHeaders(final HttpMethod method, final String name) {        Header[] authheaders = method.getRequestHeaders(name);        boolean clean = true;        for (int i = 0; i < authheaders.length; i++) {            Header authheader = authheaders[i];            if (authheader.isAutogenerated()) {                method.removeRequestHeader(authheader);            } else {                clean = false;            }        }        return clean;    }        private void authenticateHost(final HttpMethod method) throws AuthenticationException {        // Clean up existing authentication headers        if (!cleanAuthHeaders(method, WWW_AUTH_RESP)) {            // User defined authentication header(s) present            return;        }        AuthState authstate = method.getHostAuthState();        AuthScheme authscheme = authstate.getAuthScheme();        if (authscheme == null) {            return;        }        if (authstate.isAuthRequested() || !authscheme.isConnectionBased()) {            String host = method.getParams().getVirtualHost();            if (host == null) {                host = conn.getHost();            }            int port = conn.getPort();            AuthScope authscope = new AuthScope(                host, port,                 authscheme.getRealm(),                 authscheme.getSchemeName());              if (LOG.isDebugEnabled()) {                LOG.debug("Authenticating with " + authscope);            }            Credentials credentials = this.state.getCredentials(authscope);            if (credentials != null) {                String authstring = authscheme.authenticate(credentials, method);                if (authstring != null) {                    method.addRequestHeader(new Header(WWW_AUTH_RESP, authstring, true));                }            } else {                if (LOG.isWarnEnabled()) {                    LOG.warn("Required credentials not available for " + authscope);                    if (method.getHostAuthState().isPreemptive()) {                        LOG.warn("Preemptive authentication requested but no default " +                            "credentials available");                     }                }            }        }    }    private void authenticateProxy(final HttpMethod method) throws AuthenticationException {        // Clean up existing authentication headers        if (!cleanAuthHeaders(method, PROXY_AUTH_RESP)) {            // User defined authentication header(s) present            return;        }        AuthState authstate = method.getProxyAuthState();        AuthScheme authscheme = authstate.getAuthScheme();        if (authscheme == null) {            return;        }        if (authstate.isAuthRequested() || !authscheme.isConnectionBased()) {            AuthScope authscope = new AuthScope(                conn.getProxyHost(), conn.getProxyPort(),                 authscheme.getRealm(),                 authscheme.getSchemeName());  

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
在线亚洲一区二区| 亚洲一区二区精品视频| 亚洲乱码中文字幕| 久久精品国产一区二区三 | 国产精品麻豆欧美日韩ww| 亚洲一区二区免费视频| 国产成人免费在线视频| 欧美精品电影在线播放| 综合在线观看色| 国产伦精品一区二区三区在线观看| 在线观看欧美黄色| 国产欧美日韩亚州综合| 久久国产生活片100| 欧美疯狂做受xxxx富婆| 一区二区三区中文在线| av中文字幕一区| 国产女主播一区| 国产精品一区2区| 亚洲精品一区二区三区蜜桃下载| 日韩电影在线观看电影| 欧美人体做爰大胆视频| 亚洲午夜一区二区| 日本韩国精品一区二区在线观看| 亚洲欧洲日产国产综合网| 国内外成人在线| 精品播放一区二区| 精一区二区三区| 精品久久久久久无| 精品一区二区在线看| 日韩欧美一区在线观看| 人妖欧美一区二区| 精品精品欲导航| 久久精品国产第一区二区三区| 欧美日韩视频在线第一区| 亚洲成人免费在线| 欧美一区二区三级| 麻豆精品视频在线| 2023国产精品自拍| 国产传媒日韩欧美成人| 国产婷婷色一区二区三区在线| 国产麻豆精品一区二区| 中文子幕无线码一区tr| 处破女av一区二区| 亚洲色图欧美偷拍| 欧美午夜影院一区| 麻豆91在线看| 国产欧美日韩在线| 91老师片黄在线观看| 亚洲第一久久影院| 日韩精品在线网站| 成人做爰69片免费看网站| 亚洲精品成人悠悠色影视| 欧美性色aⅴ视频一区日韩精品| 亚洲国产精品久久一线不卡| 欧美一区二区成人6969| 国产精品99久久久久久似苏梦涵 | 亚洲欧美激情插| 欧美日韩久久久| 国产精品自产自拍| 亚洲日本韩国一区| 欧美一级夜夜爽| 国产成人av影院| 亚洲一区影音先锋| 精品日韩在线一区| 91在线高清观看| 美女网站一区二区| 亚洲视频免费在线| 精品国产乱码久久久久久浪潮| 成人精品小蝌蚪| 日本va欧美va精品发布| 中文字幕一区二区5566日韩| 制服丝袜中文字幕亚洲| 大白屁股一区二区视频| 日韩精品亚洲一区二区三区免费| 国产网站一区二区三区| 在线不卡中文字幕播放| 成人av电影在线播放| 免费观看在线综合| 亚洲美腿欧美偷拍| 久久精品亚洲精品国产欧美| 欧美日韩在线一区二区| 不卡电影免费在线播放一区| 日韩va欧美va亚洲va久久| 国产精品美女久久久久久久久久久 | 日韩av一级电影| 亚洲人成网站影音先锋播放| 精品国产污污免费网站入口 | 亚洲精品一区二区精华| 欧美日韩在线一区二区| 成人免费不卡视频| 狠狠v欧美v日韩v亚洲ⅴ| 亚洲大片免费看| 亚洲男人的天堂在线观看| 久久精品视频在线看| 日韩一二三区不卡| 欧美人妖巨大在线| 欧美日韩在线播放一区| 91小视频免费观看| 成人97人人超碰人人99| 国产盗摄女厕一区二区三区| 精品一区二区在线观看| 免费不卡在线视频| 性做久久久久久| 亚洲午夜激情av| 亚洲国产一二三| 一级日本不卡的影视| 亚洲色图20p| 综合久久一区二区三区| 国产农村妇女毛片精品久久麻豆| 久久一区二区三区国产精品| 欧美xxxx老人做受| 欧美变态凌虐bdsm| 2024国产精品视频| 久久精品夜夜夜夜久久| 久久久国产精品午夜一区ai换脸| 精品久久久久久久久久久久包黑料| 337p亚洲精品色噜噜噜| 欧美日本一区二区| 91精选在线观看| 日韩欧美成人一区二区| 精品对白一区国产伦| 久久综合网色—综合色88| 久久久久久久久久久黄色| 久久精品一区四区| 国产精品免费aⅴ片在线观看| 国产精品另类一区| 中文字幕视频一区| 一级精品视频在线观看宜春院 | 有坂深雪av一区二区精品| 夜夜揉揉日日人人青青一国产精品 | 色av成人天堂桃色av| 在线欧美日韩精品| 在线播放91灌醉迷j高跟美女| 91麻豆精品国产| 久久久久综合网| 亚洲另类春色校园小说| 日韩精品一级中文字幕精品视频免费观看 | 国产精品99久久久久久久vr| 成人一级视频在线观看| 91在线看国产| 欧美一区二区久久| 国产亚洲综合在线| 亚洲精品videosex极品| 日韩电影在线观看电影| 国产精品1区2区3区| 97se亚洲国产综合在线| 337p亚洲精品色噜噜狠狠| 久久精品一区蜜桃臀影院| 一区二区三区资源| 精品一区二区三区影院在线午夜 | 激情欧美一区二区| 91亚洲精品一区二区乱码| 欧美一级国产精品| 亚洲私人黄色宅男| 日本中文字幕一区二区视频| 高清国产一区二区| 欧美欧美欧美欧美| 中文字幕一区在线| 蜜桃视频第一区免费观看| 91美女福利视频| 久久精品一二三| 日本免费新一区视频| 99re这里只有精品首页| 日韩一区二区高清| 亚洲一级片在线观看| 国产成人在线看| 91精品国产福利| 亚洲一区二区不卡免费| www.日本不卡| 久久久久99精品一区| 日韩激情在线观看| 色婷婷香蕉在线一区二区| 国产日韩欧美麻豆| 九色综合狠狠综合久久| 欧美欧美欧美欧美首页| 亚洲黄色在线视频| 99久久免费国产| 欧美极品少妇xxxxⅹ高跟鞋| 久久av资源网| 欧美猛男超大videosgay| 国产精品灌醉下药二区| 狠狠久久亚洲欧美| 日韩欧美在线影院| 日韩不卡在线观看日韩不卡视频| 91看片淫黄大片一级在线观看| 337p日本欧洲亚洲大胆精品| 日本特黄久久久高潮| 欧美亚洲国产bt| 亚洲男女毛片无遮挡| 成人国产电影网| 中文字幕欧美日本乱码一线二线| 久久国内精品视频| 日韩一区二区免费在线观看| 亚洲国产色一区| 欧美日韩国产免费一区二区 | 在线观看www91| 伊人开心综合网| 欧美亚洲一区二区在线| 一区二区三区在线观看欧美| 在线观看亚洲专区|