/** * Get the type of this folder. */ public synchronized int getType() throws MessagingException { if (opened) { // never throw FolderNotFoundException if folder is open if (attributes == null) exists(); // try to fetch attributes } else { checkExists(); } return type; }
/** * Get the type of this folder. */ @Override public synchronized int getType() throws MessagingException { if (opened) { // never throw FolderNotFoundException if folder is open if (attributes == null) exists(); // try to fetch attributes } else { checkExists(); } return type; }
/** * Get the attributes that the IMAP server returns with the * LIST response. * * @return array of attributes for this folder * @exception MessagingException for failures * @since JavaMail 1.3.3 */ public synchronized String[] getAttributes() throws MessagingException { checkExists(); if (attributes == null) exists(); // do a LIST to set the attributes return attributes == null ? new String[0] : attributes.clone(); }
/** * Get the attributes that the IMAP server returns with the * LIST response. * * @return array of attributes for this folder * @exception MessagingException for failures * @since JavaMail 1.3.3 */ public synchronized String[] getAttributes() throws MessagingException { checkExists(); if (attributes == null) exists(); // do a LIST to set the attributes return attributes == null ? new String[0] : attributes.clone(); }
private synchronized Folder[] doList(final String pattern, final boolean subscribed) throws MessagingException { checkExists(); // insure that this folder does exist.
private synchronized Folder[] doList(final String pattern, final boolean subscribed) throws MessagingException { checkExists(); // insure that this folder does exist.
/** * Rename this folder. */ public synchronized boolean renameTo(final Folder f) throws MessagingException { checkClosed(); // insure that we are closed. checkExists(); if (f.getStore() != store) throw new MessagingException("Can't rename across Stores"); Object ret = doCommandIgnoreFailure(new ProtocolCommand() { public Object doCommand(IMAPProtocol p) throws ProtocolException { p.rename(fullName, f.getFullName()); return Boolean.TRUE; } }); if (ret == null) return false; exists = false; attributes = null; notifyFolderRenamedListeners(f); return true; }
/** * Rename this folder. */ @Override public synchronized boolean renameTo(final Folder f) throws MessagingException { checkClosed(); // insure that we are closed. checkExists(); if (f.getStore() != store) throw new MessagingException("Can't rename across Stores"); Object ret = doCommandIgnoreFailure(new ProtocolCommand() { @Override public Object doCommand(IMAPProtocol p) throws ProtocolException { p.rename(fullName, f.getFullName()); return Boolean.TRUE; } }); if (ret == null) return false; exists = false; attributes = null; notifyFolderRenamedListeners(f); return true; }
/** * Get the deleted message count. */ public synchronized int getDeletedMessageCount() throws MessagingException { if (!opened) { checkExists(); // no way to do this on closed folders return -1; } // if opened, issue server-side search for messages that do // have the DELETED flag. Flags f = new Flags(); f.add(Flags.Flag.DELETED); try { synchronized(messageCacheLock) { int[] matches = getProtocol().search(new FlagTerm(f, true)); return matches.length; // NOTE: 'matches' is never null } } catch (ConnectionException cex) { throw new FolderClosedException(this, cex.getMessage()); } catch (ProtocolException pex) { // Shouldn't happen throw new MessagingException(pex.getMessage(), pex); } }
checkExists(); // verify that self exists
throws MessagingException { if (!opened) { checkExists();
/** * Get the deleted message count. */ @Override public synchronized int getDeletedMessageCount() throws MessagingException { if (!opened) { checkExists(); // no way to do this on closed folders return -1; } // if opened, issue server-side search for messages that do // have the DELETED flag. Flags f = new Flags(); f.add(Flags.Flag.DELETED); try { synchronized(messageCacheLock) { int[] matches = getProtocol().search(new FlagTerm(f, true)); return matches.length; // NOTE: 'matches' is never null } } catch (ConnectionException cex) { throw new FolderClosedException(this, cex.getMessage()); } catch (ProtocolException pex) { // Shouldn't happen throw new MessagingException(pex.getMessage(), pex); } }
throws MessagingException { if (!opened) { checkExists();
public synchronized void appendMessages(Message[] msgs) throws MessagingException { checkExists(); // verify that self exists
throws MessagingException { if (!opened) { checkExists();
throws MessagingException { if (!opened) { checkExists();
checkExists(); try { Status status = getStatus();
checkExists(); try { Status status = getStatus();
checkExists(); try { Status status = getStatus();
checkExists(); try { Status status = getStatus();