本文整理汇总了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));
}
示例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));
}