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

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

?? request.java

?? gcc的組建
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
/* Request.java --   Copyright (C) 2004, 2005 Free Software Foundation, Inc.This file is part of GNU Classpath.GNU Classpath is free software; you can redistribute it and/or modifyit under the terms of the GNU General Public License as published bythe Free Software Foundation; either version 2, or (at your option)any later version. GNU Classpath is distributed in the hope that it will be useful, butWITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNUGeneral Public License for more details.You should have received a copy of the GNU General Public Licensealong with GNU Classpath; see the file COPYING.  If not, write to theFree Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA02110-1301 USA.Linking this library statically or dynamically with other modules ismaking a combined work based on this library.  Thus, the terms andconditions of the GNU General Public License cover the wholecombination.As a special exception, the copyright holders of this library give youpermission to link this library with independent modules to produce anexecutable, regardless of the license terms of these independentmodules, and to copy and distribute the resulting executable underterms of your choice, provided that you also meet, for each linkedindependent module, the terms and conditions of the license of thatmodule.  An independent module is a module which is not derived fromor based on this library.  If you modify this library, you may extendthis exception to your version of the library, but you are notobligated to do so.  If you do not wish to do so, delete thisexception statement from your version. */package gnu.java.net.protocol.http;import gnu.java.net.BASE64;import gnu.java.net.LineInputStream;import java.io.IOException;import java.io.InputStream;import java.io.OutputStream;import java.net.ProtocolException;import java.security.MessageDigest;import java.security.NoSuchAlgorithmException;import java.text.DateFormat;import java.text.ParseException;import java.util.Calendar;import java.util.Date;import java.util.HashMap;import java.util.Iterator;import java.util.Map;import java.util.Properties;import java.util.zip.GZIPInputStream;import java.util.zip.InflaterInputStream;/** * A single HTTP request. * * @author Chris Burdess (dog@gnu.org) */public class Request{  /**   * The connection context in which this request is invoked.   */  protected final HTTPConnection connection;  /**   * The HTTP method to invoke.   */  protected final String method;  /**   * The path identifying the resource.   * This string must conform to the abs_path definition given in RFC2396,   * with an optional "?query" part, and must be URI-escaped by the caller.   */  protected final String path;  /**   * The headers in this request.   */  protected final Headers requestHeaders;  /**   * The request body provider.   */  protected RequestBodyWriter requestBodyWriter;  /**   * Request body negotiation threshold for 100-continue expectations.   */  protected int requestBodyNegotiationThreshold;  /**   * Map of response header handlers.   */  protected Map responseHeaderHandlers;  /**   * The authenticator.   */  protected Authenticator authenticator;  /**   * Whether this request has been dispatched yet.   */  private boolean dispatched;  /**   * Constructor for a new request.   * @param connection the connection context   * @param method the HTTP method   * @param path the resource path including query part   */  protected Request(HTTPConnection connection, String method,                    String path)  {    this.connection = connection;    this.method = method;    this.path = path;    requestHeaders = new Headers();    responseHeaderHandlers = new HashMap();    requestBodyNegotiationThreshold = 4096;  }  /**   * Returns the connection associated with this request.   * @see #connection   */  public HTTPConnection getConnection()  {    return connection;  }  /**   * Returns the HTTP method to invoke.   * @see #method   */  public String getMethod()  {    return method;  }  /**   * Returns the resource path.   * @see #path   */  public String getPath()  {    return path;  }  /**   * Returns the full request-URI represented by this request, as specified   * by HTTP/1.1.   */  public String getRequestURI()  {    return connection.getURI() + path;  }  /**   * Returns the headers in this request.   */  public Headers getHeaders()  {    return requestHeaders;  }  /**   * Returns the value of the specified header in this request.   * @param name the header name   */  public String getHeader(String name)  {    return requestHeaders.getValue(name);  }  /**   * Returns the value of the specified header in this request as an integer.   * @param name the header name   */  public int getIntHeader(String name)  {    return requestHeaders.getIntValue(name);  }  /**   * Returns the value of the specified header in this request as a date.   * @param name the header name   */  public Date getDateHeader(String name)  {    return requestHeaders.getDateValue(name);  }  /**   * Sets the specified header in this request.   * @param name the header name   * @param value the header value   */  public void setHeader(String name, String value)  {    requestHeaders.put(name, value);  }  /**   * Convenience method to set the entire request body.   * @param requestBody the request body content   */  public void setRequestBody(byte[] requestBody)  {    setRequestBodyWriter(new ByteArrayRequestBodyWriter(requestBody));  }  /**   * Sets the request body provider.   * @param requestBodyWriter the handler used to obtain the request body   */  public void setRequestBodyWriter(RequestBodyWriter requestBodyWriter)  {    this.requestBodyWriter = requestBodyWriter;  }  /**   * Sets a callback handler to be invoked for the specified header name.   * @param name the header name   * @param handler the handler to receive the value for the header   */  public void setResponseHeaderHandler(String name,                                       ResponseHeaderHandler handler)  {    responseHeaderHandlers.put(name, handler);  }  /**   * Sets an authenticator that can be used to handle authentication   * automatically.   * @param authenticator the authenticator   */  public void setAuthenticator(Authenticator authenticator)  {    this.authenticator = authenticator;  }  /**   * Sets the request body negotiation threshold.   * If this is set, it determines the maximum size that the request body   * may be before body negotiation occurs(via the   * <code>100-continue</code> expectation). This ensures that a large   * request body is not sent when the server wouldn't have accepted it   * anyway.   * @param threshold the body negotiation threshold, or &lt;=0 to disable   * request body negotation entirely   */  public void setRequestBodyNegotiationThreshold(int threshold)  {    requestBodyNegotiationThreshold = threshold;  }  /**   * Dispatches this request.   * A request can only be dispatched once; calling this method a second   * time results in a protocol exception.   * @exception IOException if an I/O error occurred   * @return an HTTP response object representing the result of the operation   */  public Response dispatch()    throws IOException  {    if (dispatched)      {        throw new ProtocolException("request already dispatched");      }    final String CRLF = "\r\n";    final String HEADER_SEP = ": ";    final String US_ASCII = "US-ASCII";    final String version = connection.getVersion();    Response response;    int contentLength = -1;    boolean retry = false;    int attempts = 0;    boolean expectingContinue = false;    if (requestBodyWriter != null)      {        contentLength = requestBodyWriter.getContentLength();        if (contentLength > requestBodyNegotiationThreshold)          {            expectingContinue = true;            setHeader("Expect", "100-continue");          }        else          {            setHeader("Content-Length", Integer.toString(contentLength));          }      }        try      {        // Loop while authentication fails or continue        do          {            retry = false;                        // Get socket output and input streams            OutputStream out = connection.getOutputStream();            // Request line            String requestUri = path;            if (connection.isUsingProxy() &&                !"*".equals(requestUri) &&                !"CONNECT".equals(method))              {                requestUri = getRequestURI();              }            String line = method + ' ' + requestUri + ' ' + version + CRLF;            out.write(line.getBytes(US_ASCII));            // Request headers            for (Iterator i = requestHeaders.keySet().iterator();                 i.hasNext(); )              {                String name =(String) i.next();                String value =(String) requestHeaders.get(name);                line = name + HEADER_SEP + value + CRLF;                out.write(line.getBytes(US_ASCII));              }            out.write(CRLF.getBytes(US_ASCII));            // Request body            if (requestBodyWriter != null && !expectingContinue)              {                byte[] buffer = new byte[4096];                int len;                int count = 0;                                requestBodyWriter.reset();                do                  {                    len = requestBodyWriter.write(buffer);                    if (len > 0)                      {                        out.write(buffer, 0, len);                      }                    count += len;                  }                while (len > -1 && count < contentLength);              }            out.flush();            // Get response            while(true)            {              response = readResponse(connection.getInputStream());              int sc = response.getCode();              if (sc == 401 && authenticator != null)                {                  if (authenticate(response, attempts++))                    {                      retry = true;                    }                }              else if (sc == 100)                {                  if (expectingContinue)                    {                      requestHeaders.remove("Expect");                      setHeader("Content-Length",                                Integer.toString(contentLength));                      expectingContinue = false;                      retry = true;                    }                  else                    {                      // A conforming server can send an unsoliceted                      // Continue response but *should* not (RFC 2616                      // sec 8.2.3).  Ignore the bogus Continue                      // response and get the real response that                      // should follow                      continue;                    }                }              break;            }          }        while (retry);      }    catch (IOException e)      {        connection.close();        throw e;      }    return response;  }      Response readResponse(InputStream in)    throws IOException  {    String line;    int len;        // Read response status line    LineInputStream lis = new LineInputStream(in);    line = lis.readLine();    if (line == null)      {        throw new ProtocolException("Peer closed connection");      }    if (!line.startsWith("HTTP/"))      {        throw new ProtocolException(line);      }    len = line.length();    int start = 5, end = 6;    while (line.charAt(end) != '.')      {        end++;      }    int majorVersion = Integer.parseInt(line.substring(start, end));    start = end + 1;    end = start + 1;    while (line.charAt(end) != ' ')      {        end++;      }    int minorVersion = Integer.parseInt(line.substring(start, end));    start = end + 1;    end = start + 3;    int code = Integer.parseInt(line.substring(start, end));    String message = line.substring(end + 1, len - 1);    // Read response headers    Headers responseHeaders = new Headers();    responseHeaders.parse(lis);    notifyHeaderHandlers(responseHeaders);    InputStream body = null;    

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
视频在线观看国产精品| 精品sm在线观看| a亚洲天堂av| 日欧美一区二区| 午夜精品久久久久久久99水蜜桃| 精品一区二区三区久久| 一本到三区不卡视频| 精品美女在线播放| 亚洲另类色综合网站| 国产美女在线精品| 91精品国产色综合久久久蜜香臀| 国产精品私人影院| 久久精品国产网站| 宅男在线国产精品| 一区二区高清免费观看影视大全| 国产乱子轮精品视频| 欧美一区二区在线看| 一区二区三区成人在线视频| 国产99久久精品| 精品国产一区a| 日本中文字幕不卡| 7777精品伊人久久久大香线蕉| 欧美极品aⅴ影院| 欧美日韩国产精品成人| 99视频一区二区三区| 91原创在线视频| 精品国产乱子伦一区| 亚洲va韩国va欧美va| 91色porny蝌蚪| 国产精品传媒在线| 成人午夜激情视频| 中文字幕欧美区| 国产河南妇女毛片精品久久久| 日韩免费性生活视频播放| 日韩精品五月天| 91精品婷婷国产综合久久性色 | 午夜精品福利在线| 欧美少妇一区二区| 亚洲午夜久久久| 欧美日韩久久一区二区| 亚洲成av人片在线观看无码| 国产成人亚洲精品青草天美| 亚洲主播在线播放| 国产日韩欧美一区二区三区综合 | 专区另类欧美日韩| 亚洲婷婷在线视频| 成人在线综合网| 1区2区3区精品视频| 99re热这里只有精品视频| 日韩一区欧美小说| 欧美在线影院一区二区| 性感美女久久精品| 欧美一区二区三区四区高清 | 国产精品蜜臀在线观看| 91首页免费视频| 亚洲综合一区二区三区| 91.com在线观看| 久久99热狠狠色一区二区| 久久国产剧场电影| 欧美日韩不卡一区| 日本成人在线看| 欧美一级久久久| 日韩1区2区日韩1区2区| 久久综合久色欧美综合狠狠| 国产.欧美.日韩| 亚洲精品视频一区二区| 91精品国产入口| 国产成人av影院| 亚洲精品少妇30p| 日韩欧美色综合网站| 白白色亚洲国产精品| 性感美女久久精品| 日本一区二区三区视频视频| 在线看国产一区二区| 美腿丝袜亚洲综合| 亚洲欧洲精品一区二区三区不卡| 欧美日韩免费在线视频| 国产成人在线观看| 首页欧美精品中文字幕| 国产欧美日韩视频在线观看| 日本道精品一区二区三区| 欧美肥妇free| 国产麻豆精品在线观看| 欧美另类变人与禽xxxxx| 国产精品 日产精品 欧美精品| 一区二区三区日韩精品视频| 欧美成人精品1314www| 色婷婷综合激情| 国产jizzjizz一区二区| 午夜成人在线视频| **性色生活片久久毛片| 久久亚洲免费视频| 欧美一级日韩免费不卡| 91久久精品午夜一区二区| 国产一区 二区| 婷婷久久综合九色国产成人| ...xxx性欧美| 国产欧美一区二区精品仙草咪| 欧美一区二区三区四区视频| 99视频在线精品| 成人深夜在线观看| 国产一区二区伦理| 免费成人结看片| 日日摸夜夜添夜夜添亚洲女人| 国产精品成人在线观看| 久久精品夜夜夜夜久久| 亚洲精品在线免费观看视频| 欧美一级在线免费| 69堂成人精品免费视频| 欧美日韩免费不卡视频一区二区三区| 99热在这里有精品免费| 国产成人精品免费网站| 国产精品一区二区x88av| 久久激五月天综合精品| 青青草一区二区三区| 日日摸夜夜添夜夜添亚洲女人| 精品一区二区在线免费观看| 日韩高清国产一区在线| 婷婷综合五月天| 日韩综合小视频| 午夜成人免费电影| 日本伊人精品一区二区三区观看方式| 亚洲国产一区二区三区| 午夜电影一区二区三区| 首页国产欧美久久| 裸体健美xxxx欧美裸体表演| 久久国产夜色精品鲁鲁99| 精品在线免费视频| 国产成人h网站| 99久久精品国产一区| 91福利国产成人精品照片| 欧美性欧美巨大黑白大战| 欧美日韩大陆一区二区| 91.成人天堂一区| 久久综合狠狠综合久久激情| 国产拍揄自揄精品视频麻豆| 中文字幕一区二区三区四区 | 日日摸夜夜添夜夜添精品视频| 肉肉av福利一精品导航| 久热成人在线视频| 国产91清纯白嫩初高中在线观看| 99精品热视频| 欧美日韩视频在线第一区| 日韩精品专区在线影院重磅| 精品久久久久久无| 国产精品成人在线观看| 亚洲国产日韩av| 精品一区二区三区免费| 国产91丝袜在线18| 亚洲精品成人在线| 国内精品在线播放| 菠萝蜜视频在线观看一区| 欧美综合欧美视频| 日韩免费观看高清完整版在线观看| 久久亚洲精精品中文字幕早川悠里| 国产精品大尺度| 麻豆专区一区二区三区四区五区| 丁香激情综合五月| 欧美精品丝袜中出| 亚洲国产精品高清| 免费看日韩a级影片| 99天天综合性| 精品国偷自产国产一区| 亚洲蜜臀av乱码久久精品| 激情综合网最新| 在线观看不卡视频| 久久久99免费| 日韩精品亚洲一区| 91丝袜呻吟高潮美腿白嫩在线观看| 国产精品久线在线观看| 日韩电影免费一区| 色屁屁一区二区| 国产午夜三级一区二区三| 亚洲成人一二三| 91丨九色丨尤物| 国产夜色精品一区二区av| 日本中文一区二区三区| 免费观看在线综合| 在线观看免费亚洲| 亚洲18女电影在线观看| 欧美videossexotv100| 亚洲激情成人在线| 春色校园综合激情亚洲| 精品日韩在线观看| 日韩激情一二三区| 日本高清不卡视频| 国产精品国产三级国产aⅴ中文| 另类成人小视频在线| 欧美午夜电影一区| 亚洲一区二区三区四区五区中文| 国产九色sp调教91| 精品不卡在线视频| 美腿丝袜一区二区三区| 欧美一区日韩一区| 日韩av一区二区三区四区| 欧美色老头old∨ideo| 国产精品久久久久久久浪潮网站 | 欧美va亚洲va在线观看蝴蝶网| 亚洲电影一区二区三区| 欧美亚洲高清一区二区三区不卡|