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

Method getDeletedMessageCount

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

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

()

Source from the content-addressed store, hash-verified

826 * @since JavaMail 1.3
827 */
828 public synchronized int getDeletedMessageCount() throws MessagingException {
829 if (!isOpen())
830 return -1;
831
832 int deleted = 0;
833 int total = getMessageCount();
834 for (int i = 1; i <= total; i++) {
835 try {
836 if (getMessage(i).isSet(Flags.Flag.DELETED))
837 deleted++;
838 } catch (MessageRemovedException me) {
839 // This is an expunged message, ignore it.
840 continue;
841 }
842 }
843 return deleted;
844 }
845
846 /**
847 * Get the Message object corresponding to the given message

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