/** * Servers that support the UIDPLUS extension * (<A HREF="http://www.ietf.org/rfc/rfc4315.txt">RFC 4315</A>) * may indicate that this folder does not support persistent UIDs; * that is, UIDVALIDITY will be different each time the folder is * opened. Only valid when the folder is open. * * @return true if UIDs are not sticky * @exception MessagingException for failures * @exception IllegalStateException if the folder isn't open * @see "RFC 4315" * @since JavaMail 1.6.0 */ public synchronized boolean getUIDNotSticky() throws MessagingException { checkOpened(); return uidNotSticky; }
/** * Send the IMAP ID command (if supported by the server) and return * the result from the server. The ID command identfies the client * to the server and returns information about the server to the client. * See <A HREF="http://www.ietf.org/rfc/rfc2971.txt">RFC 2971</A>. * The returned Map is unmodifiable. * * @param clientParams a Map of keys and values identifying the client * @return a Map of keys and values identifying the server * @exception MessagingException if the server doesn't support the * ID extension * @since JavaMail 1.5.1 */ @SuppressWarnings("unchecked") public Map<String, String> id(final Map<String, String> clientParams) throws MessagingException { checkOpened(); return (Map<String,String>)doOptionalCommand("ID not supported", new ProtocolCommand() { public Object doCommand(IMAPProtocol p) throws ProtocolException { return p.id(clientParams); } }); }
/** * Send the IMAP ID command (if supported by the server) and return * the result from the server. The ID command identfies the client * to the server and returns information about the server to the client. * See <A HREF="http://www.ietf.org/rfc/rfc2971.txt">RFC 2971</A>. * The returned Map is unmodifiable. * * @param clientParams a Map of keys and values identifying the client * @return a Map of keys and values identifying the server * @exception MessagingException if the server doesn't support the * ID extension * @since JavaMail 1.5.1 */ @SuppressWarnings("unchecked") public Map<String, String> id(final Map<String, String> clientParams) throws MessagingException { checkOpened(); return (Map<String,String>)doOptionalCommand("ID not supported", new ProtocolCommand() { @Override public Object doCommand(IMAPProtocol p) throws ProtocolException { return p.id(clientParams); } }); }
/** * Set the specified flags for the given range of message numbers. */ public synchronized void setFlags(int start, int end, Flags flag, boolean value) throws MessagingException { checkOpened(); Message[] msgs = new Message[end - start + 1]; int i = 0; for (int n = start; n <= end; n++) msgs[i++] = getMessage(n); setFlags(msgs, flag, value); }
/** * Get the specified message. */ public synchronized Message getMessage(int msgnum) throws MessagingException { checkOpened(); checkRange(msgnum); return messageCache.getMessage(msgnum); }
/** * Set the specified flags for the given array of message numbers. */ public synchronized void setFlags(int[] msgnums, Flags flag, boolean value) throws MessagingException { checkOpened(); Message[] msgs = new Message[msgnums.length]; for (int i = 0; i < msgnums.length; i++) msgs[i] = getMessage(msgnums[i]); setFlags(msgs, flag, value); }
/** * Set the specified flags for the given array of message numbers. */ @Override public synchronized void setFlags(int[] msgnums, Flags flag, boolean value) throws MessagingException { checkOpened(); Message[] msgs = new Message[msgnums.length]; for (int i = 0; i < msgnums.length; i++) msgs[i] = getMessage(msgnums[i]); setFlags(msgs, flag, value); }
/** * Get the specified message. */ @Override public synchronized Message getMessage(int msgnum) throws MessagingException { checkOpened(); checkRange(msgnum); return messageCache.getMessage(msgnum); }
/** * Set the specified flags for the given range of message numbers. */ @Override public synchronized void setFlags(int start, int end, Flags flag, boolean value) throws MessagingException { checkOpened(); Message[] msgs = new Message[end - start + 1]; int i = 0; for (int n = start; n <= end; n++) msgs[i++] = getMessage(n); setFlags(msgs, flag, value); }
/** * {@inheritDoc} */ @Override public synchronized Message[] getMessages() throws MessagingException { /* * Need to override Folder method to throw FolderClosedException * instead of IllegalStateException if not really closed. */ checkOpened(); int total = getMessageCount(); Message[] msgs = new Message[total]; for (int i = 1; i <= total; i++) msgs[i - 1] = messageCache.getMessage(i); return msgs; }
/** * {@inheritDoc} */ @Override public synchronized Message[] getMessages() throws MessagingException { /* * Need to override Folder method to throw FolderClosedException * instead of IllegalStateException if not really closed. */ checkOpened(); int total = getMessageCount(); Message[] msgs = new Message[total]; for (int i = 1; i <= total; i++) msgs[i - 1] = messageCache.getMessage(i); return msgs; }
checkOpened(); // insure that folder is open
public synchronized Message[] getMessagesByUID(long start, long end) throws MessagingException { checkOpened(); // insure that folder is open
checkOpened(); // insure folder is open
"Message does not belong to this folder"); checkOpened(); // insure that folder is open
/** * Set the specified flags for the given array of messages. */ public synchronized void setFlags(Message[] msgs, Flags flag, boolean value) throws MessagingException { checkOpened(); checkFlags(flag); // validate flags if (msgs.length == 0) // boundary condition return; synchronized(messageCacheLock) { try { IMAPProtocol p = getProtocol(); MessageSet[] ms = Utility.toMessageSetSorted(msgs, null); if (ms == null) throw new MessageRemovedException( "Messages have been removed"); p.storeFlags(ms, flag, value); } catch (ConnectionException cex) { throw new FolderClosedException(this, cex.getMessage()); } catch (ProtocolException pex) { throw new MessagingException(pex.getMessage(), pex); } } }
/** * Set the specified flags for the given array of messages. */ @Override public synchronized void setFlags(Message[] msgs, Flags flag, boolean value) throws MessagingException { checkOpened(); checkFlags(flag); // validate flags if (msgs.length == 0) // boundary condition return; synchronized(messageCacheLock) { try { IMAPProtocol p = getProtocol(); MessageSet[] ms = Utility.toMessageSetSorted(msgs, null); if (ms == null) throw new MessageRemovedException( "Messages have been removed"); p.storeFlags(ms, flag, value); } catch (ConnectionException cex) { throw new FolderClosedException(this, cex.getMessage()); } catch (ProtocolException pex) { throw new MessagingException(pex.getMessage(), pex); } } }
long start, long end, long modseq) throws MessagingException { checkOpened(); // insure that folder is open
long start, long end, long modseq) throws MessagingException { checkOpened(); // insure that folder is open