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

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

?? multipartpostmethod.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/methods/MultipartPostMethod.java,v 1.27 2004/10/06 03:39:59 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.methods;import java.io.File;import java.io.FileNotFoundException;import java.io.IOException;import java.io.OutputStream;import java.util.ArrayList;import java.util.List;import org.apache.commons.httpclient.HttpConnection;import org.apache.commons.httpclient.HttpException;import org.apache.commons.httpclient.HttpState;import org.apache.commons.httpclient.methods.multipart.FilePart;import org.apache.commons.httpclient.methods.multipart.Part;import org.apache.commons.httpclient.methods.multipart.StringPart;import org.apache.commons.logging.Log;import org.apache.commons.logging.LogFactory;/** * Implements the HTTP multipart POST method. * <p> * The HTTP multipart POST method is defined in section 3.3 of * <a href="http://www.ietf.org/rfc/rfc1867.txt">RFC1867</a>: * <blockquote> * The media-type multipart/form-data follows the rules of all multipart * MIME data streams as outlined in RFC 1521. The multipart/form-data contains  * a series of parts. Each part is expected to contain a content-disposition  * header where the value is "form-data" and a name attribute specifies  * the field name within the form, e.g., 'content-disposition: form-data;  * name="xxxxx"', where xxxxx is the field name corresponding to that field. * Field names originally in non-ASCII character sets may be encoded using  * the method outlined in RFC 1522. * </blockquote> * </p> * <p> * * @author <a href="mailto:mattalbright@yahoo.com">Matthew Albright</a> * @author <a href="mailto:jsdever@apache.org">Jeff Dever</a> * @author <a href="mailto:adrian@ephox.com">Adrian Sutton</a> * @author <a href="mailto:mdiggory@latte.harvard.edu">Mark Diggory</a> * @author <a href="mailto:mbowler@GargoyleSoftware.com">Mike Bowler</a> * @author <a href="mailto:oleg@ural.ru">Oleg Kalnichevski</a> * * @since 2.0 *  * @deprecated Use {@link org.apache.commons.httpclient.methods.multipart.MultipartRequestEntity} * in conjunction with {@link org.apache.commons.httpclient.methods.PostMethod} instead. */public class MultipartPostMethod extends ExpectContinueMethod {    /** The Content-Type for multipart/form-data. */    public static final String MULTIPART_FORM_CONTENT_TYPE =         "multipart/form-data";    /** Log object for this class. */    private static final Log LOG = LogFactory.getLog(MultipartPostMethod.class);    /** The parameters for this method */    private final List parameters = new ArrayList();    /**     * No-arg constructor.     */    public MultipartPostMethod() {        super();    }    /**     * Constructor specifying a URI.     *     * @param uri either an absolute or relative URI     */    public MultipartPostMethod(String uri) {        super(uri);    }    /**     * Returns <tt>true</tt>      *      * @return <tt>true</tt>     *      * @since 2.0beta1     */    protected boolean hasRequestContent() {        return true;    }    /**     * Returns <tt>"POST"</tt>.     * @return <tt>"POST"</tt>     */    public String getName() {        return "POST";    }    /**     * Adds a text field part     *      * @param parameterName The name of the parameter.     * @param parameterValue The value of the parameter.     */    public void addParameter(String parameterName, String parameterValue) {        LOG.trace("enter addParameter(String parameterName, String parameterValue)");        Part param = new StringPart(parameterName, parameterValue);        parameters.add(param);    }    /**     * Adds a binary file part     *      * @param parameterName The name of the parameter     * @param parameterFile The name of the file.     * @throws FileNotFoundException If the file cannot be found.     */    public void addParameter(String parameterName, File parameterFile)     throws FileNotFoundException {        LOG.trace("enter MultipartPostMethod.addParameter(String parameterName, "            + "File parameterFile)");        Part param = new FilePart(parameterName, parameterFile);        parameters.add(param);    }    /**     * Adds a binary file part with the given file name     *      * @param parameterName The name of the parameter     * @param fileName The file name     * @param parameterFile The file     * @throws FileNotFoundException If the file cannot be found.     */    public void addParameter(String parameterName, String fileName, File parameterFile)     throws FileNotFoundException {        LOG.trace("enter MultipartPostMethod.addParameter(String parameterName, "            + "String fileName, File parameterFile)");        Part param = new FilePart(parameterName, fileName, parameterFile);        parameters.add(param);    }            /**     * Adds a part.     *      * @param part The part to add.     */    public void addPart (final Part part) {        LOG.trace("enter addPart(Part part)");        parameters.add(part);    }    /**     * Returns all parts.     *      * @return an array of containing all parts     */    public Part[] getParts() {        return (Part[]) parameters.toArray(new Part[parameters.size()]);    }    /**     * Adds a <tt>Content-Length</tt> request header, as long as no      * <tt>Content-Length</tt> request header already exists.     *     * @param state current state of http requests     * @param conn the connection to use for I/O     *     * @throws IOException if an I/O (transport) error occurs. Some transport exceptions     *                     can be recovered from.     * @throws HttpException  if a protocol exception occurs. Usually protocol exceptions      *                    cannot be recovered from.     *      * @since 3.0     */    protected void addContentLengthRequestHeader(HttpState state,                                                 HttpConnection conn)    throws IOException, HttpException {        LOG.trace("enter EntityEnclosingMethod.addContentLengthRequestHeader("                  + "HttpState, HttpConnection)");        if (getRequestHeader("Content-Length") == null) {             long len = getRequestContentLength();            addRequestHeader("Content-Length", String.valueOf(len));        }        removeRequestHeader("Transfer-Encoding");    }    /**     * Adds a <tt>Content-Type</tt> request header.     *     * @param state current state of http requests     * @param conn the connection to use for I/O     *     * @throws IOException if an I/O (transport) error occurs. Some transport exceptions     *                     can be recovered from.     * @throws HttpException  if a protocol exception occurs. Usually protocol exceptions      *                    cannot be recovered from.     *      * @since 3.0     */    protected void addContentTypeRequestHeader(HttpState state,                                                 HttpConnection conn)    throws IOException, HttpException {        LOG.trace("enter EntityEnclosingMethod.addContentTypeRequestHeader("                  + "HttpState, HttpConnection)");        if (!parameters.isEmpty()) {            StringBuffer buffer = new StringBuffer(MULTIPART_FORM_CONTENT_TYPE);            if (Part.getBoundary() != null) {                buffer.append("; boundary=");                buffer.append(Part.getBoundary());            }            setRequestHeader("Content-Type", buffer.toString());        }    }    /**     * Populates the request headers map to with additional      * {@link org.apache.commons.httpclient.Header headers} to be submitted to      * the given {@link HttpConnection}.     *     * <p>     * This implementation adds tt>Content-Length</tt> and <tt>Content-Type</tt>     * headers, when appropriate.     * </p>     *     * <p>     * Subclasses may want to override this method to to add additional     * headers, and may choose to invoke this implementation (via     * <tt>super</tt>) to add the "standard" headers.     * </p>     *     * @param state the {@link HttpState state} information associated with this method     * @param conn the {@link HttpConnection connection} used to execute     *        this HTTP method     *     * @throws IOException if an I/O (transport) error occurs. Some transport exceptions     *                     can be recovered from.     * @throws HttpException  if a protocol exception occurs. Usually protocol exceptions      *                    cannot be recovered from.     *     * @see #writeRequestHeaders     */    protected void addRequestHeaders(HttpState state, HttpConnection conn)     throws IOException, HttpException {        LOG.trace("enter MultipartPostMethod.addRequestHeaders(HttpState state, "            + "HttpConnection conn)");        super.addRequestHeaders(state, conn);        addContentLengthRequestHeader(state, conn);        addContentTypeRequestHeader(state, conn);    }    /**     * Writes the request body to the given {@link HttpConnection connection}.     *     * @param state the {@link HttpState state} information associated with this method     * @param conn the {@link HttpConnection connection} used to execute     *        this HTTP method     *     * @return <tt>true</tt>     *     * @throws IOException if an I/O (transport) error occurs. Some transport exceptions     *                     can be recovered from.     * @throws HttpException  if a protocol exception occurs. Usually protocol exceptions      *                    cannot be recovered from.     */    protected boolean writeRequestBody(HttpState state, HttpConnection conn)     throws IOException, HttpException {        LOG.trace("enter MultipartPostMethod.writeRequestBody(HttpState state, "            + "HttpConnection conn)");        OutputStream out = conn.getRequestOutputStream();        Part.sendParts(out, getParts());        return true;    }    /**     * <p>Return the length of the request body.</p>     *     * <p>Once this method has been invoked, the request parameters cannot be     * altered until the method is {@link #recycle recycled}.</p>     *      * @return The request content length.     */    protected long getRequestContentLength() throws IOException {        LOG.trace("enter MultipartPostMethod.getRequestContentLength()");        return Part.getLengthOfParts(getParts());    }    /**     * Recycles the HTTP method so that it can be used again.     * Note that all of the instance variables will be reset     * once this method has been called. This method will also     * release the connection being used by this HTTP method.     *      * @see #releaseConnection()     *      * @deprecated no longer supported and will be removed in the future     *             version of HttpClient     */    public void recycle() {        LOG.trace("enter MultipartPostMethod.recycle()");        super.recycle();        parameters.clear();    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
狠狠色狠狠色综合日日91app| 亚洲国产精华液网站w| 欧美男女性生活在线直播观看| 欧美精品在线一区二区三区| 久久综合九色综合久久久精品综合| 国产精品乱人伦中文| 午夜久久久久久| 国产电影精品久久禁18| 欧美日韩大陆在线| 久久成人免费日本黄色| 色婷婷av久久久久久久| 2024国产精品视频| 粉嫩av一区二区三区粉嫩| 91精品视频网| 亚洲成a天堂v人片| 97国产一区二区| 久久久久久亚洲综合影院红桃| 视频在线观看国产精品| 91一区二区在线| 国产精品久久一级| 国产成人鲁色资源国产91色综| 亚洲欧洲三级电影| 成人一级视频在线观看| 欧美国产日韩亚洲一区| 88在线观看91蜜桃国自产| 国产一区二区三区在线看麻豆| 亚洲精品在线一区二区| 日韩国产精品久久久久久亚洲| 欧美丝袜丝交足nylons图片| 亚洲情趣在线观看| 99国产精品国产精品久久| 亚洲成在人线免费| 国产精品视频在线看| 在线电影院国产精品| 成人激情免费电影网址| 国产精品美女一区二区三区 | 日本不卡1234视频| 欧美男同性恋视频网站| 国产成人av影院| 午夜av区久久| 亚洲免费在线观看| 久久久www免费人成精品| 欧美久久久久久久久中文字幕| 成人性生交大片免费| 免费看黄色91| 亚洲444eee在线观看| 亚洲欧美一区二区三区国产精品 | 精品国精品国产尤物美女| 色哟哟亚洲精品| 福利一区在线观看| 久久av老司机精品网站导航| 一区二区视频在线看| 国产精品99久久久久久久vr| 国产精品国产自产拍高清av王其| 91精品国产一区二区人妖| 美国毛片一区二区| 久久精品视频在线免费观看| av不卡在线播放| 亚洲一区二区三区四区的| 欧美成人a视频| 国产电影一区二区三区| 老司机免费视频一区二区| 午夜精品久久久久影视| 亚洲精品成人精品456| 亚洲欧美一区二区不卡| 欧美极品xxx| 国产欧美久久久精品影院| 欧美综合一区二区| 美女网站色91| 久久精品国产亚洲aⅴ| 日韩av在线发布| 日本成人在线电影网| 青青草国产精品97视觉盛宴| 婷婷一区二区三区| 热久久国产精品| 免费观看成人av| 激情五月婷婷综合网| 国产综合久久久久久久久久久久| 精品一二三四区| 亚洲综合无码一区二区| 一区二区日韩av| 亚洲chinese男男1069| 日日摸夜夜添夜夜添国产精品| 日韩激情av在线| 久久草av在线| 成人综合激情网| 成人99免费视频| 日本高清不卡一区| 风间由美一区二区三区在线观看 | 国产成a人无v码亚洲福利| 国产69精品久久久久毛片| 成人禁用看黄a在线| 色婷婷av一区二区三区大白胸 | 久久亚洲一级片| 久久久蜜桃精品| 国产精品不卡一区二区三区| 亚洲免费资源在线播放| 青椒成人免费视频| 国产精品系列在线播放| 一本大道久久a久久精二百 | 26uuuu精品一区二区| 欧美激情一区二区三区四区| 亚洲精品久久7777| 美美哒免费高清在线观看视频一区二区 | 97精品国产露脸对白| 欧美精品久久久久久久久老牛影院| 欧美一区二区三区四区五区| 久久久久久亚洲综合影院红桃 | 久久精品99国产国产精| 国产凹凸在线观看一区二区| 91在线porny国产在线看| 欧美日韩视频在线第一区| 国产成人无遮挡在线视频| 91丝袜美腿高跟国产极品老师| 7777精品伊人久久久大香线蕉最新版| 精品成人佐山爱一区二区| 亚洲综合精品自拍| 国产精品1区二区.| 欧美在线免费播放| 国产欧美一二三区| 性久久久久久久| 波多野结衣视频一区| 在线成人av影院| 中文字幕一区免费在线观看| 日韩avvvv在线播放| 91浏览器打开| 国产婷婷色一区二区三区四区 | 中文字幕一区二区三区蜜月| 日本欧美加勒比视频| 日本韩国欧美一区| 国产欧美日韩久久| 久久黄色级2电影| 欧美亚洲综合另类| 中文字幕一区二区三区在线观看| 午夜国产精品一区| 日本福利一区二区| 国产精品电影一区二区| 久久97超碰色| 欧美一区二区三区啪啪| 亚洲国产日韩av| 免费在线欧美视频| 欧美一a一片一级一片| 国产精品乱人伦| 国产专区欧美精品| 日韩精品专区在线影院观看 | 91精品国产aⅴ一区二区| 亚洲视频你懂的| 日韩国产欧美在线视频| 一本色道久久综合亚洲精品按摩| 久久久久亚洲综合| 激情综合色综合久久综合| 欧美日本乱大交xxxxx| 一区二区三区四区不卡在线 | 亚洲国产日韩综合久久精品| 99久久精品国产网站| 国产精品美女视频| 丰满亚洲少妇av| 国产三级欧美三级日产三级99 | 色婷婷综合激情| 亚洲人123区| 色综合色综合色综合| 亚洲婷婷在线视频| 99精品视频中文字幕| 中文字幕不卡在线播放| 粉嫩在线一区二区三区视频| 国产日韩精品一区| 国产超碰在线一区| 日韩一区有码在线| 91精品福利视频| 亚洲国产综合在线| 欧美片网站yy| 久久99精品久久只有精品| 精品美女被调教视频大全网站| 狠狠色丁香久久婷婷综合丁香| 欧美精品一区二| 懂色av一区二区三区免费观看| 国产欧美精品一区二区色综合朱莉| 风间由美性色一区二区三区| 1000精品久久久久久久久| 97se亚洲国产综合自在线| 一区二区三区四区不卡视频| 在线不卡中文字幕播放| 另类人妖一区二区av| 久久久国产精品不卡| www.av亚洲| 亚洲成av人片在www色猫咪| 日韩色在线观看| 一区二区日韩电影| 91麻豆精品国产91久久久久| 蜜臀久久99精品久久久画质超高清| 精品国产一区二区三区av性色| 国产露脸91国语对白| 亚洲欧美日韩电影| 7777女厕盗摄久久久| 国产一区二区剧情av在线| 亚洲欧洲www| 日韩免费性生活视频播放| 成人美女在线观看| 香蕉av福利精品导航| 久久综合色天天久久综合图片|