MCPcopy Create free account
hub / github.com/M66B/FairEmail / getNewMessageCount

Method getNewMessageCount

app/src/main/java/javax/mail/Folder.java:735–752  ·  view source on GitHub ↗

Get the number of new messages in this Folder. This method can be invoked on a closed folder. However, note that for some folder implementations, getting the new message count can be an expensive operation involving actually opening the folder. In such cases, a provider can choose not to suppor

()

Source from the content-addressed store, hash-verified

733 * @exception MessagingException for other failures
734 */
735 public synchronized int getNewMessageCount()
736 throws MessagingException {
737 if (!isOpen())
738 return -1;
739
740 int newmsgs = 0;
741 int total = getMessageCount();
742 for (int i = 1; i <= total; i++) {
743 try {
744 if (getMessage(i).isSet(Flags.Flag.RECENT))
745 newmsgs++;
746 } catch (MessageRemovedException me) {
747 // This is an expunged message, ignore it.
748 continue;
749 }
750 }
751 return newmsgs;
752 }
753
754 /**
755 * Get the total number of unread messages in this Folder. <p>

Callers

nothing calls this directly

Calls 4

isOpenMethod · 0.95
getMessageCountMethod · 0.95
getMessageMethod · 0.95
isSetMethod · 0.45

Tested by

no test coverage detected