/** * Get the default folder, representing the root of this user's * namespace. Returns a closed DefaultFolder object. */ public synchronized Folder getDefaultFolder() throws MessagingException { checkConnected(); return new DefaultFolder(this); }
/** * Get this message's IMAP sequence number. * * ASSERT: This method must be called only when holding the * messageCacheLock. * * @return the message sequence number */ protected int getSequenceNumber() { return ((IMAPFolder)folder).messageCache.seqnumOf(getMessageNumber()); }
/** * Get the specified message. */ public synchronized Message getMessage(int msgnum) throws MessagingException { checkOpened(); checkRange(msgnum); return messageCache.getMessage(msgnum); }
/** * Get this folder's parent. */ public synchronized Folder getParent() throws MessagingException { char c = getSeparator(); int index; if ((index = fullName.lastIndexOf(c)) != -1) return ((IMAPStore)store).newIMAPFolder( fullName.substring(0, index), c); else return new DefaultFolder((IMAPStore)store); }
/** * 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); }
/** * Get named folder. Returns a new, closed IMAPFolder. */ public synchronized Folder getFolder(String name) throws MessagingException { checkConnected(); return newIMAPFolder(name, IMAPFolder.UNKNOWN_SEPARATOR); }
/** * Close this folder without waiting for the server. * * @exception MessagingException for failures */ public synchronized void forceClose() throws MessagingException { close(false, true); }
/** * Open this folder in the given mode. */ public synchronized void open(int mode) throws MessagingException { open(mode, null); }
/** * List all subscribed subfolders matching the specified pattern. */ public Folder[] listSubscribed(String pattern) throws MessagingException { return doList(pattern, true); }
/** * Create a new IMAPMessage object to represent the given message number. * Subclasses of IMAPFolder may override this method to create a * subclass of IMAPMessage. * * @param msgnum the message sequence number * @return the new IMAPMessage object * @since JavaMail 1.4.6 */ protected IMAPMessage newIMAPMessage(int msgnum) { return new IMAPMessage(this, msgnum); }
/** * Reads the next byte of data from this buffered input stream. * If no byte is available, the value <code>-1</code> is returned. */ public synchronized int read() throws IOException { if (bufpos >= bufcount) { fill(); if (bufpos >= bufcount) return -1; // EOF } return buf[bufpos++] & 0xff; }
/** * Remove the rights specified in the ACL from the entry for the * identifier specified in the ACL. * * @param acl the identifer and rights to remove * @exception MessagingException if the server doesn't support the * ACL extension */ public void removeRights(ACL acl) throws MessagingException { setACL(acl, '-'); }
/** * Create an IMAPFolder object. Call the newIMAPFolder method * above with a null isNamespace. * * @param fullName the full name of the folder * @param separator the separator character for the folder hierarchy * @return the new IMAPFolder object */ protected IMAPFolder newIMAPFolder(String fullName, char separator) { return newIMAPFolder(fullName, separator, null); }
public void run() { // send the DONE and wait for the response folder0.idleAbortWait(); } });
/** * Returns email store. * * @param session {@link Session} * @return {@link com.sun.mail.imap.IMAPSSLStore} */ @Override protected IMAPSSLStore getStore(final Session session) { SimpleAuthenticator simpleAuthenticator = (SimpleAuthenticator) authenticator; final URLName url; if (simpleAuthenticator == null) { url = new URLName( PROTOCOL_IMAP, host, port, StringPool.EMPTY, null, null); } else { final PasswordAuthentication pa = simpleAuthenticator.getPasswordAuthentication(); url = new URLName( PROTOCOL_IMAP, host, port, StringPool.EMPTY, pa.getUserName(), pa.getPassword()); } return new IMAPSSLStore(session, url); }
/** * Get the specified message. */ @Override public synchronized Message getMessage(int msgnum) throws MessagingException { checkOpened(); checkRange(msgnum); return messageCache.getMessage(msgnum); }
/** * Get the default folder, representing the root of this user's * namespace. Returns a closed DefaultFolder object. */ @Override public synchronized Folder getDefaultFolder() throws MessagingException { checkConnected(); return new DefaultFolder(this); }
/** * Get this message's IMAP sequence number. * * ASSERT: This method must be called only when holding the * messageCacheLock. * * @return the message sequence number */ protected int getSequenceNumber() { return ((IMAPFolder)folder).messageCache.seqnumOf(getMessageNumber()); }
this.store = ( protocol == MailConnectionMeta.PROTOCOL_POP3 ) ? new POP3SSLStore( this.session, url ) : new IMAPSSLStore( this.session, url ); url = null; } else {