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

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

?? inprotocol.java

?? 手機(jī)郵箱撒的方式方式方式的
?? JAVA
?? 第 1 頁 / 共 5 頁
字號:
package mujmail.protocols;/*MujMail - Simple mail client for J2MECopyright (C) 2006 Nguyen Son Tung <n.sontung@gmail.com>Copyright (C) 2008 David Hauzar <david.hauzar.mujmail@gmail.com>This program 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 of the License, or(at your option) any later version.This program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See theGNU General Public License for more details.You should have received a copy of the GNU General Public Licensealong with this program; if not, write to the Free SoftwareFoundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */import java.util.Hashtable;import java.util.Stack;import java.util.Vector;import mujmail.BodyPart;import mujmail.InBox;import mujmail.Lang;import mujmail.MessageHeader;import mujmail.MujMail;import mujmail.MyException;import mujmail.Settings;import mujmail.TheBox;import mujmail.account.MailAccount;import mujmail.connections.ConnectionCompressed;import mujmail.connections.ConnectionInterface;import mujmail.tasks.BackgroundTask;import mujmail.tasks.Progress;import mujmail.tasks.StoppableBackgroundTask;import mujmail.tasks.StoppableProgress;import mujmail.ui.AudioAlert;import mujmail.util.Decode;import mujmail.util.Functions;/** * The interface for manipulating and downloading mails. * For communication with servers uses the object of class BasicConnection */public abstract class InProtocol {    /** The name of this source file */    private static final String SOURCE_FILE = "InProtocol";    /** Flag signals if we want to print debug prints */    private static final boolean DEBUG = false;    private static final Object notifier = new Object(); /// Object on which wait fo beeing notify    protected InProtocolTask inProtocolTask;        /** The body part that is actually parsed. */    private BodyPart actuallyParsedBodyPart;        // TODO (Betlista): describe these constants, why have REDOWNLOAD_BODY (3) and GET_URL (5) same description?    //thread run modes    public static final byte GET_NEW_MAILS = 1;    public static final byte RETRIEVE_BODY = 2; //retrieving mail bodies    public static final byte REDOWNLOAD_BODY = 3; //reretreving mail bodies - redownload incompleted mails    public static final byte REMOVE_MAILS = 4;    public static final byte GET_URL = 5; //reretreving mail bodies - redownload incompleted mails    public static final byte SAVE_MAIL_SENT = 6;    public static final byte POLL = 8;    public static final byte SET_FLAGS = 9;    public static final byte REMOVE_FLAGS = 10;    public static final byte CONVERT_BODY = 11;    public static final byte CLOSE = 16;         byte runMode = -1;    byte reDownloadMode = -1; //-1 for redownloading the whole mail, values >= 0 for redownloading particular bodypart only    static short instanceRunning = 0; //counts how many threads ALL subclasses of Inprotocol are running    short threadCount = 0; //counts how many threads a single subclass of Inprotocol are running			    boolean locked; //for thread synchronizing    boolean forcedDisc; //if it should disconnect from the server unconditionally		    MailAccount account; //each server has an account    private TheBox reportBox = null;    /** The box to that the action of this object is associated. That means the box to that mails are actually downloded etc. */    public InBox targetBox = null;    MessageHeader actHeader; //a header which should be fetched	    protected ConnectionInterface connection;    //mailsOnServer store message unique identifier(UID) and message number of mails on the server    //its used for faster accessing to the message number     //and detecting if a concrete mail is on the server - used for inbox-server sync    //keys are UID(String) objects are message numbers(String) in the case of POP3,     //in case the case of IMAP4 objects are just random number, because we don't need to operate with message numbers in IMAP implementation	    Hashtable mailsOnServer;    String END_OF_MAIL; //a string that indicates the end of transmitting of a mail body    String saveMailData;  // data to save into server mailbox if saving on server set on    String flagsToSet = "()";        public InProtocol(MailAccount account) {        //super("In protocol task");        this.account = account;        connection = new ConnectionCompressed();        mailsOnServer = new Hashtable();    }    //return if the object is busy    public boolean isBusy() {        return (threadCount > 0) ? true : false;    }    /**     * Handles input flags - set processed message header flags according to      * these flags.     * @param flags the part of protocol line with flags     */    protected void handleFlags(MessageHeader msgHeader, String flags) {        if (DEBUG) { System.out.println("DEBUG InProtocol.handleFlags " + actHeader); }        if (flags.indexOf("\\Seen") != -1) {            msgHeader.markAsRead();        }        if (flags.indexOf("\\Answered") != -1) {            msgHeader.markAsReplied();        }        if (flags.indexOf("\\Deleted") != -1) {            msgHeader.markAsDeleted();        }        if (flags.indexOf("\\Flagged") != -1) {            msgHeader.markAsFlagged();        }    }        //zvysi counter pocet bezicich threadu    protected synchronized void inThread() {        ++threadCount;    }    protected synchronized void decThread() {        --threadCount;    }    //returns if some of all instances (POP, IMAP, SPOP..) of inProtocol are running, resp. if the class Inprotocol is busy.    public static boolean isBusyGlobal() {        return instanceRunning > 0 ? true : false;    }    protected synchronized void incThreadGlobal() {        ++instanceRunning;    }    protected synchronized void decThreadGlobal() {        --instanceRunning;        synchronized(notifier) {            notifier.notifyAll();        }    }    public void stop() {        if (isBusy()) {            connection.quit();        }    }    /*     * TODO (Betlista): add JavaDoc comment     */    public abstract int countNew() throws MyException;    protected synchronized void lock() {        try {            while (locked) {                wait(100);            }        } catch (InterruptedException e) {        }        locked = true;    }    protected void unlock() {        locked = false;    }    //add a mail to a queue of mails that are going to be deleted from the server    abstract public void addDeleted(MessageHeader header);    public boolean containsMail(MessageHeader header) {        return mailsOnServer.containsKey(header.getMessageID());    }    //synchronized to ensure no other threads are changing runMode    //all these methods must be run in a thread    /**     * Retrieve mails from server     * @param box Target inbox where add mails     */    public synchronized void getNewMails(InBox box) {          if (DEBUG) System.out.println("DEBUG InProtocol.getNewMails(InBox) - getting new mails");        incThreadGlobal();        runMode = InProtocol.GET_NEW_MAILS;        this.targetBox = box;        this.reportBox = box;        inProtocolTask = new InProtocolTask(this, "Getting new mails");        inProtocolTask.start(targetBox, MujMail.mujmail.getMenu());    }    /**     * This method should be called if polling discovers mail with given ID.     * @param ID id of new mail that was discovered by polling.     * @return true if this is new email: that means that it  was not yet     *  downloaded.     */    protected boolean handleMailDiscoveredByPolling(String ID) {            if (!getTargetBox().wasOnceDownloaded(account.getEmail(), ID)) {                if (Settings.pollDownloadsMails) {                    getNewMails( getTargetBox());                }                if (Settings.pollPlaysSound) {                    new AudioAlert();                }                return true;            }        return false;    }    /**     * Blocks calling thread until no InProtocol action of any InProtocol     * instance is running.     */    public static void waitForNotBusyGlobal() {        try {            synchronized(notifier) {                if (!isBusyGlobal()) return;                notifier.wait();            }        } catch (Exception e) {            System.out.println(e.toString());            e.printStackTrace();        }    }    /**     * Finds first new mail while polling. The connection is already open.     * @throws mujmail.MyException     */    protected abstract void findFirstNewMailWhilePolling() throws MyException;    /**     * <p>Opens the connection.</p>     * <p>Note: task can be null (polling).</p>     *      * @param task     * @return     * @throws mujmail.MyException     */    protected abstract boolean open(BackgroundTask task) throws MyException;    private void resolveMyExceptionWhileRunning(MyException ex) {        if (ex.getErrorCode() == MyException.COM_HALTED) {            connection.unQuit();        }        resolveExceptions(ex.getDetails() + "/ " + account.getEmail(), SOURCE_FILE);    }    protected abstract void getNewMails();    protected abstract void downloadBody();    protected abstract void removeMails();    protected abstract void setFlags();    protected abstract void removeFlags();    protected abstract void getURL() throws MyException;    public void doWork() {        //polling is an extra thread, is not counted by inThread() or inThreadGlobal()        if (doPolling()) return;        //if its a forced disconnect, then we will not wait for someone by calling lock()        if (runMode == InProtocol.CLOSE && forcedDisc) {            closeForceDist();            return;        }        try {            //we use lock() instead of making run() synchronized in order to allow forced disconnecting from servers            //even some jobs are still running            lock();            inThread();            getReportBox().report(Lang.get(Lang.ALRT_INITIATING) + Lang.get(Lang.ALRT_WAIT), SOURCE_FILE); // Not in background task no setTitle

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美一区二区精品在线| 亚洲午夜在线电影| 91九色最新地址| 韩国一区二区在线观看| 亚洲视频狠狠干| 精品日韩一区二区三区| 色94色欧美sute亚洲线路一久| 老司机精品视频线观看86| 毛片一区二区三区| 亚洲mv大片欧洲mv大片精品| 不卡av免费在线观看| 综合欧美一区二区三区| 最新成人av在线| 99国产精品一区| 国产专区欧美精品| 午夜欧美视频在线观看 | 日韩黄色在线观看| 国产精品视频免费看| 日韩欧美不卡一区| 欧美三级电影精品| 9l国产精品久久久久麻豆| 久久99国产精品免费| 亚洲va欧美va天堂v国产综合| 亚洲丝袜精品丝袜在线| 久久久久久综合| 精品久久久久久久久久久久久久久 | 精品国产麻豆免费人成网站| 欧美日韩aaaaa| 欧美午夜影院一区| 色狠狠av一区二区三区| 91免费在线播放| 99久久er热在这里只有精品66| 国产精品羞羞答答xxdd| 韩国欧美一区二区| 久久精品国产精品亚洲精品 | 99精品国产99久久久久久白柏| 国产精品亚洲成人| 国产福利精品一区| 国产成人自拍网| 丰满少妇在线播放bd日韩电影| 久久国产人妖系列| 狠狠色丁香久久婷婷综合丁香| 麻豆成人久久精品二区三区红| 麻豆专区一区二区三区四区五区| 美女久久久精品| 久久国产三级精品| 国产在线观看免费一区| 国产自产v一区二区三区c| 国内成人免费视频| 国产精品69久久久久水密桃| 成人午夜在线播放| 91丨porny丨在线| 在线观看视频一区二区| 欧美亚洲高清一区| 欧美日韩精品专区| 日韩视频在线你懂得| 久久亚区不卡日本| 国产清纯白嫩初高生在线观看91| 国产精品剧情在线亚洲| 天堂影院一区二区| 91成人免费电影| 欧洲精品在线观看| 欧美高清精品3d| 欧美va日韩va| 国产精品久久久久久久久搜平片| 综合欧美一区二区三区| 亚洲1区2区3区视频| 奇米亚洲午夜久久精品| 国产一区欧美一区| 国产欧美精品国产国产专区 | 欧美成人精精品一区二区频| 国产亚洲精品福利| 成人免费在线播放视频| 午夜激情久久久| 国产一区视频在线看| 色综合中文综合网| 亚洲精品国产一区二区三区四区在线| 一区二区三区中文在线观看| 亚洲精品国产精品乱码不99| 日韩精品一卡二卡三卡四卡无卡| 精品一区二区日韩| 欧美色网一区二区| 亚洲天堂福利av| 日韩精品一区二区三区视频| 国产精品美女久久福利网站| 亚洲一区二区美女| 久久精品国产99久久6| 国产成人三级在线观看| 日本精品视频一区二区| 欧美大度的电影原声| 日韩毛片视频在线看| 日韩国产欧美视频| 成人av在线网| 日韩欧美一区二区免费| 亚洲免费视频中文字幕| 国产一区二区在线电影| 欧美日韩精品三区| 国产精品久久三| 另类小说综合欧美亚洲| 91久久一区二区| 国产亚洲欧美中文| 9191精品国产综合久久久久久| eeuss鲁片一区二区三区在线观看| 制服丝袜在线91| 亚洲美女视频在线| 国产美女精品在线| 欧美一区二区三区思思人| 亚洲色图欧洲色图| 国产jizzjizz一区二区| 91精品国产91久久久久久最新毛片| 成人欧美一区二区三区1314| 国产一区二区三区四区五区美女| 欧美日韩一区视频| 国产精品电影一区二区三区| 久88久久88久久久| 在线成人av网站| 亚洲第一搞黄网站| av不卡一区二区三区| 久久久久久久电影| 久久99国产精品麻豆| 欧美一三区三区四区免费在线看 | 99精品视频在线观看| 精品粉嫩超白一线天av| 亚洲h精品动漫在线观看| 在线观看网站黄不卡| 亚洲日本欧美天堂| 成人深夜视频在线观看| 国产午夜精品久久久久久久| 国产一区二区三区精品视频| 欧美成人精品3d动漫h| 蜜桃视频第一区免费观看| 777奇米四色成人影色区| 亚洲午夜在线电影| 欧美少妇bbb| 三级欧美在线一区| 欧美日韩国产高清一区二区三区 | 精品久久久久久久久久久久久久久 | 欧美aaaaaa午夜精品| 欧美日韩三级一区二区| 一区二区久久久| 欧美性受xxxx| 午夜激情一区二区三区| 欧美伦理电影网| 日本少妇一区二区| 欧美一区二区三区婷婷月色| 精品一区二区三区久久| 久久综合一区二区| 国产91丝袜在线播放| 中文字幕中文字幕中文字幕亚洲无线| 成人一区二区视频| 综合久久久久综合| 欧美自拍偷拍午夜视频| 亚洲一级片在线观看| 欧美精品国产精品| 蜜臀av一区二区| 国产欧美综合色| 91一区二区在线观看| 亚洲一二三四区不卡| 欧美三级视频在线| 蜜桃av噜噜一区| 欧美国产精品一区二区三区| 91在线看国产| 亚洲国产成人精品视频| 日韩一区二区三区三四区视频在线观看 | 国产精品免费网站在线观看| 99久久精品一区| 亚洲成人自拍一区| 欧美成人精品3d动漫h| 国产成人av在线影院| 一区二区三区精品久久久| 3751色影院一区二区三区| 九九热在线视频观看这里只有精品| 日本一区二区高清| 欧洲一区二区三区免费视频| 久久er精品视频| 国产精品麻豆一区二区| 欧美色图天堂网| 国产伦精品一区二区三区在线观看| 综合欧美亚洲日本| 日韩免费视频一区| eeuss国产一区二区三区| 日日嗨av一区二区三区四区| 国产欧美日韩综合| 欧美三级乱人伦电影| 国产一区二区精品久久91| 亚洲精品国产成人久久av盗摄 | 日韩欧美黄色影院| 成人av资源在线| 毛片一区二区三区| 亚洲女女做受ⅹxx高潮| 亚洲精品在线网站| 在线观看亚洲专区| 国产成人精品三级| 天天免费综合色| 国产精品拍天天在线| 欧美一区二区三区的| 色综合久久久久综合体| 国产成人精品影视| 免费三级欧美电影| 亚洲最大的成人av|