当前位置: 首页>>代码示例>>Java>>正文


Java FolderException.setResponseCode方法代码示例

本文整理汇总了Java中com.icegreen.greenmail.store.FolderException.setResponseCode方法的典型用法代码示例。如果您正苦于以下问题:Java FolderException.setResponseCode方法的具体用法?Java FolderException.setResponseCode怎么用?Java FolderException.setResponseCode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.icegreen.greenmail.store.FolderException的用法示例。


在下文中一共展示了FolderException.setResponseCode方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: doProcess

import com.icegreen.greenmail.store.FolderException; //导入方法依赖的package包/类
public void doProcess(ImapRequestLineReader request,
                          ImapResponse response,
                          ImapSession session,
                          boolean useUids)
            throws ProtocolException, FolderException {
        IdRange[] idSet = parser.parseIdRange(request);
        String mailboxName = parser.mailbox(request);
        parser.endLine(request);

        ImapSessionFolder currentMailbox = session.getSelected();
        MailFolder toFolder;
        try {
            toFolder = getMailbox(mailboxName, session, true);
        } catch (FolderException e) {
            e.setResponseCode("TRYCREATE");
            throw e;
        }

//        if (! useUids) {
//            idSet = currentMailbox.toUidSet(idSet);
//        }
//        currentMailbox.copyMessages(toMailbox, idSet);

        List<Long> copiedUidsOld = new ArrayList<Long>();
        List<Long> copiedUidsNew = new ArrayList<Long>();

        long[] uids = currentMailbox.getMessageUids();
        for (int i = 0; i < uids.length; i++) {
            long uid = uids[i];
            boolean inSet;
            if (useUids) {
                inSet = includes(idSet, uid);
            } else {
                int msn = currentMailbox.getMsn(uid);
                inSet = includes(idSet, msn);
            }

            if (inSet) {
                long copiedUid = currentMailbox.copyMessage(uid, toFolder);
                
                copiedUidsOld.add(uid);
                copiedUidsNew.add(copiedUid);
            }
        }

        session.unsolicitedResponses(response);

        response.commandComplete(this, genereteCopyuidResponseCode(toFolder, copiedUidsOld, copiedUidsNew));
    }
 
开发者ID:Alfresco,项目名称:alfresco-greenmail,代码行数:50,代码来源:CopyCommand.java

示例2: doProcess

import com.icegreen.greenmail.store.FolderException; //导入方法依赖的package包/类
@Override
public void doProcess(ImapRequestLineReader request,
                      ImapResponse response,
                      ImapSession session,
                      boolean useUids)
        throws ProtocolException, FolderException {
    IdRange[] idSet = parser.parseIdRange(request);
    String mailboxName = parser.mailbox(request);
    parser.endLine(request);

    ImapSessionFolder currentMailbox = session.getSelected();
    MailFolder toFolder;
    try {
        toFolder = getMailbox(mailboxName, session, true);
    } catch (FolderException e) {
        e.setResponseCode("TRYCREATE");
        throw e;
    }

    List<Long> copiedUidsOld = new ArrayList<>();
    List<Long> copiedUidsNew = new ArrayList<>();

    long[] uids = currentMailbox.getMessageUids();
    for (long uid : uids) {
        boolean inSet;
        if (useUids) {
            inSet = includes(idSet, uid);
        } else {
            int msn = currentMailbox.getMsn(uid);
            inSet = includes(idSet, msn);
        }

        if (inSet) {
            long copiedUid = currentMailbox.copyMessage(uid, toFolder);
            copiedUidsOld.add(uid);
            copiedUidsNew.add(copiedUid);
        }
    }

    session.unsolicitedResponses(response);
    response.commandComplete(this, generateCopyUidResponseCode(currentMailbox, copiedUidsOld, copiedUidsNew));
}
 
开发者ID:greenmail-mail-test,项目名称:greenmail,代码行数:43,代码来源:CopyCommand.java


注:本文中的com.icegreen.greenmail.store.FolderException.setResponseCode方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。