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

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

?? getmessage.java

?? Myjxta的源代碼 基于JXTA的P2P即時(shí)通信系統(tǒng)
?? JAVA
字號(hào):
/** Copyright (c) 2001 Sun Microsystems, Inc.  All rights* reserved.** Redistribution and use in source and binary forms, with or without* modification, are permitted provided that the following conditions* are met:** 1. Redistributions of source code must retain the above copyright*    notice, this list of conditions and the following disclaimer.** 2. Redistributions in binary form must reproduce the above copyright*    notice, this list of conditions and the following disclaimer in*    the documentation and/or other materials provided with the*    distribution.** 3. The end-user documentation included with the redistribution,*    if any, must include the following acknowledgment:*       "This product includes software developed by the*       Sun Microsystems, Inc. for Project JXTA."*    Alternately, this acknowledgment may appear in the software itself,*    if and wherever such third-party acknowledgments normally appear.** 4. The names "Sun", "Sun Microsystems, Inc.", "RosettaChat", "JXTA" and*    "Project JXTA" must not be used to endorse or promote products derived*    from this software without prior written permission. For written*    permission, please contact Project JXTA at http://www.jxta.org.** 5. Products derived from this software may not be called "JXTA",*    nor may "JXTA" appear in their name, without prior written*    permission of Sun.** THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE* DISCLAIMED.  IN NO EVENT SHALL SUN MICROSYSTEMS OR* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF* SUCH DAMAGE.* ====================================================================** This software consists of voluntary contributions made by many* individuals on behalf of Project JXTA.  For more* information on Project JXTA, please see* <http://www.jxta.org/>.** This license is based on the BSD license adopted by the Apache Foundation.*/package net.jxta.myjxta.misc.rosettachat.http;import net.jxta.myjxta.misc.rosettachat.misc.EmptyIterator;import java.io.*;import java.net.HttpURLConnection;import java.net.URL;import java.net.URLConnection;import java.security.Provider;import java.security.Security;import java.util.HashMap;import java.util.Iterator;import java.util.Map;/** * GetMessage.java * * @author James Todd [jwtodd@pacbell.net] */public class GetMessage {    protected String method = null;    protected Message message = null;    protected URLConnection connection = null;    private static final String PROVIDER =            "com.sun.net.ssl.internal.ssl.Provider";    private static boolean VERBOSE = false;    private URL url = null;    private boolean isUnicodeEncoding = false;    private boolean isFollowRedirect = false;    static {        try {            Class clazz = Class.forName(PROVIDER);            if (Provider.class.isAssignableFrom(clazz)) {                Provider provider = (Provider) clazz.newInstance();                Security.addProvider(provider);            }        } catch (ClassNotFoundException cnfe) {            if (VERBOSE) {                cnfe.printStackTrace();            }        } catch (IllegalAccessException iae) {            if (VERBOSE) {                iae.printStackTrace();            }        } catch (InstantiationException ie) {            if (VERBOSE) {                ie.printStackTrace();            }        } catch (SecurityException se) {            if (VERBOSE) {                se.printStackTrace();            }        }    }    public GetMessage() {        this(null, null);    }    public GetMessage(URL url) {        this(url, null);    }    public GetMessage(URL url, Message message) {        this.url = url;        this.method = Constants.HTTP.GET;        this.message = message;    }    public URL getURL() {        return this.url;    }    public void setURL(URL url) {        this.url = url;    }    public String getHeader(String key) {        return ((this.message != null) ?                (String) this.message.getHeader(key) : null);    }    public Iterator getHeaderKeys() {        return ((this.message != null) ?                this.message.getHeaderKeys() : new EmptyIterator());    }    public void setHeaders(Map headers) {        Iterator keys = headers.keySet().iterator();        while (keys.hasNext()) {            String key = (String) keys.next();            String value = (String) headers.get(key);            setHeader(key, value);        }    }    public void setHeader(String key, String value) {        if (this.message == null) {            this.message = new Message();        }        this.message.setHeader(key, value);    }    public void removeHeader(String key)            throws NullPointerException {        if (key == null) {            throw new NullPointerException("null key");        }        if (this.message != null) {            this.message.removeHeader(key);        }    }    public boolean isUnicodeEncoding() {        return this.isUnicodeEncoding;    }    public void setUnicodeEncoding(boolean isUnicodeEncoding) {        this.isUnicodeEncoding = isUnicodeEncoding;    }    public boolean isFollowRedirect() {        return this.isFollowRedirect;    }    public void setFollowRedirect(boolean isFollowRedirect) {        this.isFollowRedirect = isFollowRedirect;    }    public Message dispatch()            throws IOException {        openConnection();        try {            doGet();        } catch (IOException ioe) {            throw new IOException(ioe.getMessage());        }        Message response = getResponse();        closeConnection();        return response;    }    public String toString() {        java.lang.Class<? extends GetMessage> clazz = getClass();        java.lang.reflect.Field[] fields = clazz.getDeclaredFields();        java.util.HashMap<String, Object> map = new java.util.HashMap<String, Object>();        java.lang.String object = null;        java.lang.Object value = null;        for (int i = 0; i < fields.length; i++) {            try {                object = fields[i].getName();                value = fields[i].get(this);                map.put(object, (value != null) ? value : "null");            } catch (IllegalAccessException iae) {                iae.printStackTrace();            }        }        if (clazz.getSuperclass().getSuperclass() != null) {            map.put("super", clazz.getSuperclass().toString());        }        return clazz.getName() + map;    }    protected String getBody() {        return ((this.message != null &&                this.message.hasBody()) ?                (String) this.message.getBody() : null);    }    protected void setBody(String body) {        if (this.message == null) {            this.message = new Message();        }        this.message.setBody((body != null) ? body : "");    }    protected void openConnection()            throws IllegalStateException, IOException {        if (this.url == null) {            throw new IllegalStateException("null url");        }        if (this.url.getProtocol().equalsIgnoreCase("http") ||                this.url.getProtocol().equalsIgnoreCase("https")) {            openHTTPConnection();        } else {            openFileConnection();        }    }    protected void closeConnection() {        if (this.connection instanceof HttpURLConnection) {            ((HttpURLConnection) this.connection).disconnect();        }        this.connection = null;    }    protected void doGet()            throws IOException {    }    protected Message getResponse() throws IOException {        Map<String, String> headers = getResponseHeaders();        String body = "";        body = getResponseBody();        return new Message(headers, body);    }    private void openHTTPConnection()            throws IOException {        this.connection = (HttpURLConnection) this.url.openConnection();        ((HttpURLConnection) this.connection).setRequestMethod(this.method);        if (this.message != null) {            Iterator keys = this.message.getHeaderKeys();            while (keys.hasNext()) {                String key = (String) keys.next();                String value = (String) this.message.getHeader(key);                this.connection.setRequestProperty(key, value);            }        }        boolean doOutput = (this.method.equals(Constants.HTTP.POST) &&                this.message != null &&                this.message.hasBody());        Map defaultHeaders = ((!doOutput) ?                Util.getDefaultGetHeaders() :                Util.getDefaultPostHeaders());        Iterator defaultHeaderKeys = defaultHeaders.keySet().iterator();        while (defaultHeaderKeys.hasNext()) {            String key = (String) defaultHeaderKeys.next();            if (this.connection.getRequestProperty(key) == null) {                String value = (String) defaultHeaders.get(key);                this.connection.setRequestProperty(key, value);            }        }        if (doOutput) {            int l = this.message.getBody().toCharArray().length;            this.connection.setRequestProperty(Constants.MIME.Key.CONTENT_LENGTH,                    Integer.toString(l));        }        this.connection.setDoOutput(doOutput);        this.connection.setDoInput(true);        this.connection.setUseCaches(false);        HttpURLConnection.setFollowRedirects(this.isFollowRedirect);    }    private void openFileConnection()            throws IOException {        this.connection = this.url.openConnection();    }    private Map<String, String> getResponseHeaders() {        Map<String, String> headers = null;        // xxx        // required as java.net.HttpURLConnection.getHeaderFieldKey(int)        // appears to prematurely return a null - bummer        //for (int i = 0; true; i++) {        for (int i = 0; i < Constants.HTTP.MAX_HEADERS; i++) {            String key = this.connection.getHeaderFieldKey(i);            if (key != null) {                String value = this.connection.getHeaderField(key);                if (headers == null) {                    headers = new HashMap<String, String>();                }                headers.put(key, value);            }        }        return headers;    }    private String getResponseBody()            throws IOException {        final int BLOCK = 1024;        InputStream is = this.connection.getInputStream();        String contentType = this.connection.getContentType();        InputStreamReader isr =                ((this.isUnicodeEncoding) ?                        new InputStreamReader(is, Util.getCharSet(contentType)) :                        new InputStreamReader(is));        BufferedReader reader = new BufferedReader(isr);        char[] buf = new char[1024];        int l = 0;        //int contentLength = this.connection.getContentLength();        CharArrayWriter writer = new CharArrayWriter();        while ((l = reader.read(buf, 0, BLOCK)) > -1) {            writer.write(buf, 0, l);        }        reader.close();        return ((this.isUnicodeEncoding) ?                Util.toUnicodeEncoded(new String(writer.toCharArray())) :                new String(writer.toCharArray()));    }}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩国产在线观看一区| 不卡的av在线播放| 亚洲嫩草精品久久| 欧美成人在线直播| 色综合久久六月婷婷中文字幕| 久久精品国产99国产| 一区二区三区日韩欧美| 久久看人人爽人人| 日韩午夜电影在线观看| 欧美无砖专区一中文字| 波波电影院一区二区三区| 激情综合亚洲精品| 日韩av电影一区| 亚洲国产精品人人做人人爽| 成人欧美一区二区三区视频网页| 久久新电视剧免费观看| 日韩免费看网站| 在线播放中文字幕一区| 欧美日韩亚州综合| 一本一道久久a久久精品综合蜜臀| 国产91富婆露脸刺激对白| 精品亚洲成a人在线观看| 免费观看成人鲁鲁鲁鲁鲁视频| 五月综合激情网| 亚洲制服丝袜av| 樱花影视一区二区| 日韩伦理电影网| 亚洲视频在线观看一区| 亚洲视频图片小说| 亚洲人快播电影网| 亚洲免费观看高清完整版在线| 成人免费一区二区三区视频 | 欧美性三三影院| 色狠狠色噜噜噜综合网| 色94色欧美sute亚洲线路二| 91免费国产在线| 91老师国产黑色丝袜在线| 波多野结衣的一区二区三区| 99精品视频在线观看| 99精品久久只有精品| 91丝袜呻吟高潮美腿白嫩在线观看| youjizz国产精品| 色香色香欲天天天影视综合网| 色婷婷av一区二区三区gif| 在线观看免费一区| 欧美精品在线视频| 日韩精品一区国产麻豆| 久久久久88色偷偷免费| 国产精品久久久久精k8| 亚洲男人的天堂一区二区| 亚洲小说欧美激情另类| 日韩精品欧美精品| 韩国成人福利片在线播放| 国产成人在线视频免费播放| 99久久99久久精品国产片果冻| 在线观看三级视频欧美| 欧美日韩成人综合天天影院 | 一本一道波多野结衣一区二区| 色婷婷综合中文久久一本| 欧美在线观看一区| 日韩女优毛片在线| 亚洲国产高清在线观看视频| 亚洲欧美日韩人成在线播放| 午夜精品免费在线观看| 精品综合久久久久久8888| 成人免费观看视频| 在线免费观看日韩欧美| 日韩欧美激情四射| 国产精品无码永久免费888| 亚洲一区二区三区视频在线| 蜜桃一区二区三区在线| 成人一二三区视频| 欧美天天综合网| 精品动漫一区二区三区在线观看| 欧美国产禁国产网站cc| 五月天国产精品| 国产成人av影院| 欧美日韩不卡一区| 国产女人aaa级久久久级| 亚洲成a人片在线不卡一二三区| 精品一区二区久久久| 色婷婷一区二区| 欧美变态凌虐bdsm| 一区二区三区.www| 国产成人日日夜夜| 欧美一级欧美三级在线观看 | 亚洲国产中文字幕在线视频综合| 老汉av免费一区二区三区| 色综合网色综合| 日韩精品资源二区在线| 亚洲欧美一区二区三区国产精品 | 色先锋aa成人| 久久精品欧美日韩精品| 日韩精品一区第一页| 99热这里都是精品| 精品国产精品网麻豆系列| 亚洲最大的成人av| 国产高清久久久| 91麻豆精品国产自产在线观看一区 | 久久精品国产澳门| 欧美性猛交xxxxxx富婆| 国产精品成人免费| 国产一区二区不卡老阿姨| 这里是久久伊人| 亚洲一区视频在线| 99久久久国产精品| 中文字幕av一区二区三区高| 免费观看在线综合色| 欧美日韩精品免费观看视频| 成人欧美一区二区三区| 粉嫩一区二区三区在线看| 久久综合99re88久久爱| 久久99国产精品成人| 日韩一区二区视频在线观看| 亚洲自拍欧美精品| 91久久国产综合久久| 国产精品久久久99| 成人高清在线视频| 欧美国产精品一区二区| 国产精品白丝jk白祙喷水网站 | 亚洲国产成人av| 日本福利一区二区| 亚洲免费在线观看视频| 99久久综合99久久综合网站| 国产精品二三区| 大尺度一区二区| 国产精品久久久久永久免费观看 | 欧美日韩电影一区| 亚洲国产精品嫩草影院| 欧美日韩一区成人| 亚洲第一电影网| 欧美精品日日鲁夜夜添| 天天影视网天天综合色在线播放| 欧美午夜片在线看| 日韩国产欧美在线视频| 日韩一二三区视频| 韩国v欧美v亚洲v日本v| 欧美韩日一区二区三区四区| 99久久伊人久久99| 一区二区三区波多野结衣在线观看| 在线看不卡av| 日韩vs国产vs欧美| 精品少妇一区二区三区在线播放 | 欧美在线观看视频在线| 午夜精品福利一区二区蜜股av | 成人免费在线观看入口| 在线亚洲人成电影网站色www| 亚洲一二三区视频在线观看| 3d成人h动漫网站入口| 韩国毛片一区二区三区| 国产精品激情偷乱一区二区∴| 色综合中文综合网| 欧美在线免费播放| 日本v片在线高清不卡在线观看| 亚洲精品一区二区三区99| 国产不卡视频在线播放| 亚洲精品欧美激情| 日韩一二三区视频| 成人午夜视频网站| 亚洲一区二三区| 日韩欧美国产一区二区三区| 国产高清不卡一区二区| 一区二区三区丝袜| 精品久久一二三区| 91色.com| 麻豆精品视频在线观看免费| 中文字幕一区二区三区色视频| 欧美色爱综合网| 国产一区二区主播在线| 亚洲黄色在线视频| 2021中文字幕一区亚洲| 91美女片黄在线观看| 看国产成人h片视频| 亚洲天堂精品在线观看| 欧美一区二区三区在线| youjizz国产精品| 蓝色福利精品导航| 亚洲精品久久7777| 久久女同性恋中文字幕| 欧美三级中文字幕在线观看| 国产精品一区二区久久精品爱涩| 亚洲欧美日韩在线| 久久久久免费观看| 欧美肥胖老妇做爰| 成人免费高清在线| 欧美激情综合在线| 69久久夜色精品国产69蝌蚪网| 国产成a人无v码亚洲福利| 日韩不卡一二三区| 亚洲美女区一区| 国产日韩欧美激情| 日韩欧美亚洲国产另类| 在线一区二区三区| 不卡的电影网站| 韩国理伦片一区二区三区在线播放| 亚洲国产精品久久人人爱| 国产精品成人免费在线| 久久久久久久av麻豆果冻| 欧美一区二区在线观看| 91国模大尺度私拍在线视频|