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

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

?? imapclient.java

?? 使用java編寫的手機郵件系統(tǒng)
?? JAVA
字號:
/****************************************************************************** * Mail4ME - Mail for the Java 2 Micro Edition * * A lightweight, J2ME- (and also J2SE-) compatible package for sending and * receiving Internet mail messages using the SMTP and POP3 protocols. * * Copyright (c) 2000-2002 J鰎g Pleumann <joerg@pleumann.de> * * Mail4ME is part of the EnhydraME family of projects. See the following web * sites for more information: * * -> http://mail4me.enhydra.org * -> http://me.enhydra.org * * Mail4ME is distributed under the Enhydra Public License (EPL), which is * discussed in great detail here: * * -> http://www.enhydra.org/software/license/index.html * * Have fun! ******************************************************************************/package de.trantor.mail;import java.io.InputStream;import java.io.OutputStream;import java.io.IOException;/** * Encapsulates the IMAP v4.1 protocol as specified in RFC 2060. This class * provides a simple interface to a IMAP mailbox. After a session has been * established using the open() method, the number of available messages can be * queried by calling the getMessageCount() method, and arbitrary messages or * their headers can be retrieved from the mailbox using getMessage() or * getHeaders(), respectively. Deleting messages is possible using * removeMessage(). Each IMAP session should be terminated by a call to the * close() method. * * @see MailException * @see SmtpClient * @see Message */public class ImapClient extends InboxClient {    /**     * Counts the commands executed so far in this session. Every command of an     * IMAP session needs a unique ID that is prepended to the command line.     */    private int commandCount = 0;    /**     * Creates a new ImapClient instance.     */    public ImapClient() {        super(null);    }    /**     * Creates a new ImapClient instance with a given Connection instance.     */    public ImapClient(Connection connection) {        super(connection);    }    public void open(String host, int port, boolean ssl, String user, String pass) throws IOException, MailException {        /**         * Terminate any open session first.         */        if (connected()) close();        /**         * Create a connection object matching the current environment (J2ME or         * J2SE) using the factory method of Connection, then open the socket.         */        connection.open(host, (port == 0 ? 143 : port), ssl);        /**         * Swallow the initial 'hello' line from the server, then try to         * authenticate using the given username and password. If something         * goes wrong, close the whole session.         */        try {            execute("LOGIN", user + " " + pass, null);            execute("SELECT", "INBOX", null);        }        catch (MailException e) {            connection.close();            throw e;        }    }    public void close() throws IOException, MailException {        if (connected()) {            execute("CLOSE", null, null);            execute("LOGOUT", null, null);        }        connection.close();    }    /**     * Handles a request/response pair. This is a convenience method used     * internally to handle sending a request to the IMAP server as well as     * receiving the response. If the response starts with a "-" sign, and thus     * denotes a protocol error, an exception is raised to reflect it. Note that     * the request is only sent if it doesn't equal null, while the response is     * always being waited for.     *     * @see #send     * @see #receive     * @see MailException     */    private String execute(String command, String arguments, Message message) throws IOException, MailException {        String result = null;        String tag = "A" + commandCount++ + " ";        connection.send(tag + command + (arguments == null ? "" : " " + arguments));        String temp = connection.receive();        while (!temp.startsWith(tag)) {            if (temp.indexOf(" " + command + " ") != -1) {                int p = temp.indexOf('(');                int q = temp.indexOf(')', p + 1);                if (p != -1) {                    if (q > p) {                        result = temp.substring(p + 1, q);                    }                    else if (message != null) {                        int left = temp.indexOf('{');                        int right = temp.indexOf('}', left);                        receiveMessage(message, Integer.parseInt(temp.substring(left + 1, right)));                    }                }            }            temp = connection.receive();        }        temp = temp.substring(tag.length());        if (temp.startsWith("BAD ") || temp.startsWith("NO ")) {            throw new MailException(temp);        }        return result;    }    public int getMessageCount() throws IOException, MailException {        String buffer = execute("STATUS", "INBOX (MESSAGES)", null);        /**         * The result of the "STAT" request should always be "+OK <#msgs> <#bytes>",         * so we simply fetch the number between the first and the second space         * (and keep our fingers crossed that every POP3 implementation follows the         * RFC).         */        int space = buffer.indexOf(' ');        return Integer.parseInt(buffer.substring(space + 1));    }    /**     * Receives a message. This method receives a whole message from the server     * and stores the header and body parts in the according vectors. It is able     * to undo any byte stuffing produced by the server. It also undoes header     * folding in a way, putting multiple header lines that belong to one     * field into a single line of the header vector.     * <p>     * The method assumes that either a "RETR" or a "TOP" command has already     * been issued, so that it can only be called from the getMessage() and     * getHeader() methods (whom it serves as an internal helper method).     *     * @see #getMessage     * @see #getHeaders     */    private void receiveMessage(Message message, int size) throws IOException, MailException {        int count = 0;        /**         * First we read the header lines. The end of the header is denoted by         * an empty line.         */        String buffer = connection.receive();        int octets = buffer.length() + 2;        while (!(buffer.equals(""))) {            /**             * Undo header folding, that is, put logical header lines that span             * multiple physical ones into one vector entry. This eases dealing             * with header fields a lot.             */            if (buffer.startsWith(" ") || buffer.startsWith("\t")) {                message.setHeaderLine(count - 1, message.getHeaderLine(count - 1) + "\r\n" + buffer);            }            else {                message.addHeaderLine(buffer);                count++;            }            buffer = connection.receive();            octets = octets + buffer.length() + 2;        }        /**         * Next we read the body lines. The end of the body is denoted by a line         * consisting only of a dot (which is the usual end of multiline respones).         */        while (octets < size) {            buffer = connection.receive();            octets = octets + buffer.length() + 2;            message.addBodyLine(buffer);        }    }    public Message getMessage(int index) throws IOException, MailException {        Message message = new Message();        execute("FETCH", (index + 1)+ " (RFC822)", message);        return message;    }    public Message getHeaders(int index) throws IOException, MailException {        Message message = new Message();        execute("FETCH", (index + 1)+ " (RFC822.HEADER)", message);        return message;    }    public void removeMessage(int index) throws IOException, MailException {        execute("STORE", (index + 1) + " +FLAGS.SILENT (\\DELETED)", null);    }    public String getUniqueId(int index) throws IOException, MailException {        String buffer = execute("FETCH", (index + 1) + " (UID)", null); // in Klammern?        int space = buffer.indexOf(' ');        return buffer.substring(space + 1);    }    public int getSize(int index) throws IOException, MailException {        String buffer = execute("FETCH", (index + 1) + " (RFC822.SIZE)", null); // in Klammern?        int space = buffer.indexOf(' ');        return Integer.parseInt(buffer.substring(space + 1));    }}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲一区二区欧美| 亚洲欧美另类在线| 欧美视频一区在线观看| 久久精品理论片| 亚洲精品视频免费看| 久久综合中文字幕| 色综合天天综合| 国产乱码精品一区二区三区忘忧草| 一区二区三区成人在线视频| 久久精品亚洲一区二区三区浴池| 在线免费观看不卡av| 国产成人免费视频网站| 美国av一区二区| 亚洲一区电影777| 亚洲欧美怡红院| 精品久久99ma| 精品视频999| 色婷婷久久一区二区三区麻豆| 国产一区在线视频| 男女男精品网站| 亚洲va欧美va人人爽午夜| 国产精品另类一区| 26uuu亚洲综合色| 日韩精品中文字幕在线不卡尤物| 欧美网站大全在线观看| 91在线一区二区三区| 粉嫩嫩av羞羞动漫久久久| 久久综合综合久久综合| 日韩精品一二三区| 亚洲mv大片欧洲mv大片精品| 亚洲人吸女人奶水| 国产精品麻豆99久久久久久| 久久久久国色av免费看影院| 久久综合久久鬼色| 精品国产一区二区三区四区四| 制服视频三区第一页精品| 欧美丝袜丝交足nylons图片| 色天使久久综合网天天| 日本高清免费不卡视频| 一本大道久久a久久精品综合| 福利一区二区在线| 国产成人精品午夜视频免费| 国产在线不卡视频| 国产中文字幕精品| 国产尤物一区二区| 国产91精品欧美| 成人黄色免费短视频| 国产超碰在线一区| 成人99免费视频| 91毛片在线观看| 色呦呦日韩精品| 在线观看www91| 91.com视频| 精品国产1区二区| 久久久99精品久久| 1024成人网| 一区二区高清视频在线观看| 亚洲最大成人网4388xx| 香蕉久久一区二区不卡无毒影院| 亚洲成av人影院| 精品一区二区三区在线播放| 国产高清久久久久| 91小视频免费观看| 欧美日韩在线一区二区| 欧美一区二区久久| 久久久久久影视| 中文字幕一区日韩精品欧美| 亚洲资源中文字幕| 久久精品国产网站| 成人免费视频一区二区| 在线免费观看不卡av| 日韩欧美一级片| 国产精品卡一卡二卡三| 亚洲成人免费在线| 精品一区二区三区不卡| 波多野洁衣一区| 欧美日韩和欧美的一区二区| 精品国产sm最大网站免费看| 中文一区一区三区高中清不卡| 亚洲狠狠丁香婷婷综合久久久| 男女男精品视频网| av不卡一区二区三区| 7777精品伊人久久久大香线蕉的 | 色国产精品一区在线观看| 在线综合+亚洲+欧美中文字幕| 久久嫩草精品久久久精品| 一区二区不卡在线视频 午夜欧美不卡在 | 国产麻豆视频一区二区| 91色乱码一区二区三区| 欧美大白屁股肥臀xxxxxx| 中文字幕人成不卡一区| 免费成人性网站| 99久久久免费精品国产一区二区| 欧美一卡二卡三卡四卡| 尤物视频一区二区| 福利一区二区在线| 欧美tickling网站挠脚心| 亚洲精品国产一区二区精华液 | 久久噜噜亚洲综合| 亚洲电影欧美电影有声小说| 国产精品91一区二区| 欧美精品九九99久久| 国产精品欧美极品| 狠狠色丁香婷综合久久| 在线一区二区视频| 69p69国产精品| 欧美大肚乱孕交hd孕妇| 亚洲精品大片www| 狠狠色丁香婷综合久久| 精品视频在线免费| 中文字幕日本不卡| 精品一区二区三区免费观看| 色综合色综合色综合| 精品久久久久99| 亚洲一区在线观看网站| av成人免费在线观看| 日韩欧美一级精品久久| 亚洲综合一区二区| 国产成人av资源| 91精品啪在线观看国产60岁| 亚洲免费视频成人| 大桥未久av一区二区三区中文| 777午夜精品免费视频| 亚洲免费在线看| 成人精品国产福利| 日韩欧美国产一区在线观看| 亚洲狠狠丁香婷婷综合久久久| 经典三级一区二区| 精品国产91亚洲一区二区三区婷婷| 一区二区三区免费网站| 不卡电影一区二区三区| 国产午夜三级一区二区三| 香港成人在线视频| 91精品国产91综合久久蜜臀| 亚洲国产日韩综合久久精品| 99re热视频这里只精品| 国产精品乱码一区二区三区软件| 久久se这里有精品| 精品国产99国产精品| 玖玖九九国产精品| 日韩免费高清av| 丝袜a∨在线一区二区三区不卡| 色婷婷综合久久| 一区二区三区 在线观看视频| 99re这里只有精品6| 中文字幕在线不卡| av在线免费不卡| 欧美激情一区二区三区蜜桃视频| 粉嫩aⅴ一区二区三区四区五区 | 不卡的av电影| 国产亚洲成aⅴ人片在线观看| 丁香另类激情小说| 国产精品网站一区| 成人免费看黄yyy456| 日本一区二区三区久久久久久久久不| 丁香天五香天堂综合| 日本一区二区久久| 国产99久久久国产精品潘金| 国产精品热久久久久夜色精品三区| 国产91在线观看| 亚洲精选一二三| 欧美综合一区二区三区| 亚洲小说春色综合另类电影| 欧美日韩一区二区三区高清| 亚洲国产欧美另类丝袜| 欧美成人bangbros| 国产精品影视天天线| 久久久一区二区三区| 国产成人精品三级麻豆| 日韩美女视频一区| 欧美人与禽zozo性伦| 蜜桃在线一区二区三区| 国产精品国产三级国产普通话三级 | 一区二区三区久久| 欧美一区二区三区视频在线观看| 久久国产日韩欧美精品| 久久麻豆一区二区| 91在线视频免费观看| 亚洲综合久久av| 久久久久国产精品麻豆ai换脸| av爱爱亚洲一区| 午夜精品国产更新| 欧美一区二区三区影视| 9l国产精品久久久久麻豆| 亚洲国产欧美在线| www久久精品| 成人av网站免费| 琪琪久久久久日韩精品| 国产日韩欧美精品综合| 色丁香久综合在线久综合在线观看| 午夜电影久久久| 日本一区免费视频| 欧美人妇做爰xxxⅹ性高电影 | 亚洲欧美国产高清| 欧美日韩卡一卡二| 97成人超碰视| 美女视频网站黄色亚洲| 亚洲图片激情小说| 日韩欧美国产成人一区二区| 91浏览器在线视频|