emails[i].flags().remove(flagsToUnset); msg.setFlags(flagsToUnset, false);
/** * Set the flags for this message. <p> * * This implementation modifies the <code>flags</code> field. * * @exception IllegalWriteException if the underlying * implementation does not support modification * @exception IllegalStateException if this message is * obtained from a READ_ONLY folder. * @exception MessagingException for other failures */ public synchronized void setFlags(Flags flag, boolean set) throws MessagingException { if (set) flags.add(flag); else flags.remove(flag); }
/** * Set the flags for this message. <p> * * This implementation modifies the <code>flags</code> field. * * @exception IllegalWriteException if the underlying * implementation does not support modification * @exception IllegalStateException if this message is * obtained from a READ_ONLY folder. * @exception MessagingException for other failures */ @Override public synchronized void setFlags(Flags flag, boolean set) throws MessagingException { if (set) flags.add(flag); else flags.remove(flag); }
public final boolean remove(final Object tag) { if (tag instanceof String) { flags.remove(TAG_PREFIX + tag); return true; } return false; }
f.remove(Flags.Flag.RECENT); // remove RECENT from copy
f.remove(Flags.Flag.RECENT); // remove RECENT from copy
/** * Set or clear a flag value. * * @param flags The set of flags to effect. * @param set The value to set the flag to (true or false). * * @exception MessagingException */ public synchronized void setFlags(Flags flag, boolean set) throws MessagingException { if (set) { flags.add(flag); } else { flags.remove(flag); } }
/** * Set or clear a flag value. * * @param flag The set of flags to effect. * @param set The value to set the flag to (true or false). * * @exception MessagingException */ public synchronized void setFlags(Flags flag, boolean set) throws MessagingException { if (set) { flags.add(flag); } else { flags.remove(flag); } }
/** * Set the flags for this message. <p> * * This implementation modifies the <code>flags</code> field. * * @exception IllegalWriteException if the underlying * implementation does not support modification * @exception IllegalStateException if this message is * obtained from a READ_ONLY folder. * @exception MessagingException */ public synchronized void setFlags(Flags flag, boolean set) throws MessagingException { if (set) flags.add(flag); else flags.remove(flag); }
/** * Set the flags for this message. <p> * * This implementation modifies the <code>flags</code> field. * * @exception IllegalWriteException if the underlying * implementation does not support modification * @exception IllegalStateException if this message is * obtained from a READ_ONLY folder. * @exception MessagingException */ public synchronized void setFlags(Flags flag, boolean set) throws MessagingException { if (set) flags.add(flag); else flags.remove(flag); }
/** * Set the flags for this message. <p> * * This implementation modifies the <code>flags</code> field. * * @exception IllegalWriteException if the underlying * implementation does not support modification * @exception IllegalStateException if this message is * obtained from a READ_ONLY folder. * @exception MessagingException for other failures */ @Override public synchronized void setFlags(Flags flag, boolean set) throws MessagingException { if (set) flags.add(flag); else flags.remove(flag); }
/** * Set the flags for this message. <p> * * This implementation modifies the <code>flags</code> field. * * @exception IllegalWriteException if the underlying * implementation does not support modification * @exception IllegalStateException if this message is * obtained from a READ_ONLY folder. * @exception MessagingException for other failures */ @Override public synchronized void setFlags(Flags flag, boolean set) throws MessagingException { if (set) flags.add(flag); else flags.remove(flag); }
/** * Set the flags for this message. <p> * * This implementation modifies the <code>flags</code> field. * * @exception IllegalWriteException if the underlying * implementation does not support modification * @exception IllegalStateException if this message is * obtained from a READ_ONLY folder. * @exception MessagingException for other failures */ @Override public synchronized void setFlags(Flags flag, boolean set) throws MessagingException { if (set) flags.add(flag); else flags.remove(flag); }
/** * Set the flags for this message. <p> * * This implementation modifies the <code>flags</code> field. * * @exception IllegalWriteException if the underlying * implementation does not support modification * @exception IllegalStateException if this message is * obtained from a READ_ONLY folder. * @exception MessagingException for other failures */ @Override public synchronized void setFlags(Flags flag, boolean set) throws MessagingException { if (set) flags.add(flag); else flags.remove(flag); }
/** * Set the flags for this message. <p> * * This implementation modifies the <code>flags</code> field. * * @exception IllegalWriteException if the underlying * implementation does not support modification * @exception IllegalStateException if this message is * obtained from a READ_ONLY folder. * @exception MessagingException for other failures */ @Override public synchronized void setFlags(Flags flag, boolean set) throws MessagingException { if (set) flags.add(flag); else flags.remove(flag); }
/** * Set the flags for this message. <p> * * This implementation modifies the <code>flags</code> field. * * @exception IllegalWriteException if the underlying * implementation does not support modification * @exception IllegalStateException if this message is * obtained from a READ_ONLY folder. * @exception MessagingException for other failures */ @Override public synchronized void setFlags(Flags flag, boolean set) throws MessagingException { if (set) flags.add(flag); else flags.remove(flag); }
public Flags buildNewFlags(Flags oldFlags) { Flags updatedFlags = new Flags(oldFlags); switch (mode) { case REPLACE: return new Flags(providedFlags); case ADD: updatedFlags.add(providedFlags); break; case REMOVE: updatedFlags.remove(providedFlags); break; } return updatedFlags; }
flags.add(Flags.Flag.SEEN); } else { flags.remove(Flags.Flag.SEEN);
private void init() throws MailboxException { MailboxSession mailboxSession = ImapSessionUtils.getMailboxSession(session); mailboxManager.addListener(path, this, mailboxSession); MessageResultIterator messages = mailboxManager.getMailbox(path, mailboxSession).getMessages(MessageRange.all(), FetchGroupImpl.MINIMAL, mailboxSession); synchronized (this) { while(messages.hasNext()) { MessageResult mr = messages.next(); applicableFlags.add(mr.getFlags()); add(mr.getUid()); } // \RECENT is not a applicable flag in imap so remove it from the list applicableFlags.remove(Flags.Flag.RECENT); } }