Additional top-level classes in compilation unit: MessageLiteral, LengthCounter.
A closed IMAPFolder object shares a protocol connection with its IMAPStore object. When the folder is opened, it gets its own protocol connection.
Applications that need to make use of IMAP-specific features may cast
a Folder object to an IMAPFolder object and
use the methods on this class.
The getQuota and
setQuota methods support the IMAP QUOTA extension.
Refer to RFC 2087
for more information.
The getACL, addACL,
removeACL, addRights,
removeRights, listRights, and
myRights methods support the IMAP ACL extension.
Refer to RFC 2086
for more information.
The getSortedMessages
methods support the IMAP SORT extension.
Refer to RFC 5256
for more information.
The open(int,ResyncData)
method and ResyncData class supports
the IMAP CONDSTORE and QRESYNC extensions.
Refer to RFC 4551
and RFC 5162
for more information.
The doCommand method and
IMAPFolder.ProtocolCommand
interface support use of arbitrary IMAP protocol commands.
See the com.sun.mail.imap package documentation for further information on the IMAP protocol provider.
Warning
The APIs unique to this class should be considered EXPERIMENTAL. They may be changed in the future in ways that are incompatible with applications using the current APIs.
| Modifier and Type | Class and Description |
|---|---|
| public static class | IMAPFolder.FetchProfileItem
A fetch profile item for fetching headers. |
| public static interface | IMAPFolder.ProtocolCommand
A simple interface for user-defined IMAP protocol commands. |
| Modifier and Type | Field and Description |
|---|---|
| private static final int | |
| protected volatile String[] | |
| protected Flags | |
| private Status | |
| private long | |
| private MailLogger | |
| private boolean | |
| protected volatile boolean | |
| protected volatile String | |
| private boolean | |
| private volatile long | |
| private static final int | |
| private IdleManager | |
| private int | |
| protected boolean | |
| protected MailLogger | |
| protected MessageCache | |
| protected final Object | |
| protected String | |
| private volatile boolean | |
| protected Flags | |
| protected volatile IMAPProtocol | |
| private boolean | |
| private int | |
| private volatile int | |
| private static final int | |
| protected char | |
| private volatile int | |
| protected int | |
| private long | |
| private boolean | |
| protected Hashtable | |
| private long | |
| protected static final char |
| Access | Constructor and Description |
|---|---|
| protected | IMAPFolder(String
fullname of this folder fullName, char the default separator character for this
folder's namespace separator, IMAPStore the Store store, Boolean if this folder represents a namespace isNamespace)Constructor used to create a possibly non-existent folder. |
| protected | IMAPFolder(ListInfo
the ListInfo for this folder li, IMAPStore the store containing this folder store)Constructor used to create an existing folder. |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public synchronized void | addMessageCountListener(MessageCountListener
the Listener for MessageCount events l)Overrides javax. |
| public synchronized Message[] | Returns: the messages in this folderthe messages to add msgs)Append the given messages into this folder. |
| public void | |
| private void | |
| public synchronized void | appendMessages(Message[]
array of Messages to be appended msgs)Implements abstract javax. |
| public synchronized AppendUID[] | Returns: array of AppendUID objectsthe messages to append msgs)Append the given messages into this folder. |
| protected void | |
| protected void | |
| private void | |
| protected void | |
| protected void | |
| private void | |
| private MessagingException | |
| public synchronized void | close(boolean
expunges all deleted messages if this flag is true expunge)Implements abstract javax. |
| private void | |
| public synchronized void | copyMessages(Message[]
the array of message objects msgs, Folder the folder to copy the messages to folder)Overrides javax. |
| private synchronized void | copymoveMessages(Message[] msgs, Folder folder, boolean move)
Copy or move the specified messages from this folder, to the specified destination. |
| private synchronized AppendUID[] | Returns: array of AppendUID objectsthe messages to copy msgs, Folder the folder to copy the messages to folder, boolean move instead of copy? move)Copy or move the specified messages from this folder, to the specified destination. |
| public synchronized AppendUID[] | Returns: array of AppendUID objectsthe messages to copy msgs, Folder the folder to copy the messages to folder)Copy the specified messages from this folder, to the specified destination. |
| public synchronized boolean | create(final int
The type of this folder. type)Implements abstract javax. |
| private String | createHeaderCommand(String[] hdrs, boolean isRev1)
Create the appropriate IMAP FETCH command items to fetch the requested headers. |
| private Message[] | |
| public synchronized boolean | delete(boolean
also delete subfolders? recurse)Implements abstract javax. |
| public Object | Returns: the result of the commandthe protocol command cmdExecute a user-supplied IMAP command. |
| public Object | |
| private synchronized Folder[] | |
| public Object | |
| protected synchronized Object | |
| public synchronized boolean | exists()
Implements abstract javax. |
| public synchronized Message[] | |
| public synchronized Message[] | |
| public synchronized void | fetch(Message[]
fetch items for these messages msgs, FetchProfile the FetchProfile fp)Overrides javax. |
| private int | |
| public synchronized void | |
| public ACL[] | Returns: array of access control list entriesGet the access control list entries for this folder. |
| public synchronized String[] | Returns: array of attributes for this folderGet the attributes that the IMAP server returns with the LIST response. |
| pack-priv SocketChannel | |
| public synchronized int | getDeletedMessageCount()
Overrides javax. |
| protected String | Returns: the IMAP FETCH items to requestReturn the IMAP FETCH items to request in order to load all the "envelope" data. |
| public synchronized Folder | getFolder(String
name of the Folder name)Implements abstract javax. |
| public String | |
| public synchronized long | |
| public synchronized Message | getMessage(int
the message number msgnum)Implements abstract javax. |
| protected IMAPMessage | Returns: the IMAPMessage objectthe message sequence number seqnum)Get the message object for the given sequence number. |
| public synchronized Message | getMessageByUID(long
UID for the desired message uid)Implements javax. |
| public synchronized int | getMessageCount()
Implements abstract javax. |
| public synchronized Message[] | |
| protected IMAPMessage[] | Returns: the IMAPMessage objectsthe array of message sequence numbers seqnums)Get the message objects for the given sequence numbers. |
| public synchronized Message[] | getMessagesByUID(long
start UID start, long end UID end)Implements javax. |
| public synchronized Message[] | getMessagesByUID(long[]
array of UIDs uids)Implements javax. |
| public synchronized Message[] | Returns: the changed messagesthe first message number start, long the last message number end, long the MODSEQ value modseq)Get the messages that have been changed since the given MODSEQ value. |
| public synchronized String | |
| public synchronized int | |
| public synchronized Folder | |
| public synchronized Flags | getPermanentFlags()
Implements abstract javax. |
| protected IMAPProtocol | Returns: the IMAPProtocol object used when the folder is openReturn the IMAPProtocol object for this folder. |
| public Quota[] | Returns: array of Quota objects for the quotaroots associated with this folderGet the quotas for the quotaroot associated with this folder. |
| public synchronized char | |
| public synchronized Message[] | Returns: the messages in sorted orderthe SortTerms term)Sort the messages in the folder according to the sort criteria. |
| public synchronized Message[] | Returns: the messages in sorted orderthe SortTerms term, SearchTerm the SearchTerm sterm)Sort the messages in the folder according to the sort criteria. |
| private Status | |
| public synchronized long | Returns: the value of the STATUS item, or -1the STATUS item to fetch item)Use the IMAP STATUS command to get the indicated item. |
| protected synchronized IMAPProtocol | Returns: the IMAPProtocol for the Store's connectionGet this folder's Store's protocol connection. |
| public synchronized int | |
| public synchronized long | getUID(Message
Message from this folder message)Implements javax. |
| public synchronized long | Returns: the UIDNEXT value, or -1 if unknownImplements javax. |
| public synchronized boolean | Returns: true if UIDs are not stickyServers that support the UIDPLUS extension (RFC 4315) may indicate that this folder does not support persistent UIDs; that is, UIDVALIDITY will be different each time the folder is opened. |
| public synchronized long | getUIDValidity()
Implements javax. |
| public synchronized int | getUnreadMessageCount()
Overrides javax. |
| pack-priv boolean | Returns: true if we should look for more IDLE responses, false if IDLE is doneonly do one notification? once)Read a response from the server while we're in the IDLE state. |
| public void | handleResponse(Response r)
Implements com. |
| pack-priv void | |
| public synchronized boolean | hasNewMessages()
Implements abstract javax. |
| public Map | |
| public void | |
| public void | |
| pack-priv void | |
| pack-priv void | |
| private boolean | |
| public synchronized boolean | |
| private boolean | |
| public synchronized boolean | |
| protected void | keepConnectionAlive(boolean
keep the Store alive too? keepStoreAlive)Issue a noop command for the connection if the connection has not been used in more than a second. |
| public Folder[] | list(String
the match pattern pattern)Implements abstract javax. |
| public Rights[] | Returns: array of Rights objects representing possible rights for the identifierthe identifier to list rights for name)Get all the rights that may be allowed to the given identifier. |
| public Folder[] | listSubscribed(String
the match pattern pattern)Overrides javax. |
| private MessagingException | |
| public synchronized void | moveMessages(Message[]
the messages to move msgs, Folder the folder to move the messages to folder)Move the specified messages from this folder, to the specified destination. |
| public synchronized AppendUID[] | Returns: array of AppendUID objectsthe messages to move msgs, Folder the folder to move the messages to folder)Move the specified messages from this folder, to the specified destination. |
| public Rights | Returns: the rights granted to the current userGet the rights allowed to the currently authenticated user. |
| protected IMAPMessage | Returns: the new IMAPMessage objectthe message sequence number msgnum)Create a new IMAPMessage object to represent the given message number. |
| public synchronized void | open(int
open the Folder READ_ONLY or READ_WRITE mode)Implements abstract javax. |
| public synchronized List | Returns: a List of MailEvent instances, or null if nonethe open mode (Folder.READ_WRITE or Folder.READ_ONLY) mode, ResyncData the ResyncData instance rd)Open this folder in the given mode, with the given resynchronization data. |
| private Message | |
| protected void | releaseProtocol(boolean
return the protocol object to the pool? returnToPool)Release the protocol object. |
| protected synchronized void | |
| public void | |
| public void | removeRights(ACL
the identifer and rights to remove acl)Remove the rights specified in the ACL from the entry for the identifier specified in the ACL. |
| public synchronized boolean | renameTo(final Folder
a folder representing the new name for this Folder f)Implements abstract javax. |
| public synchronized Message[] | Returns: the messages that matchthe search term term)Overrides javax. |
| public synchronized Message[] | search(SearchTerm
the search criterion term, Message[] the messages to be searched msgs)Overrides javax. |
| private void | |
| public synchronized void | setFlags(Message[]
the array of message objects msgs, Flags Flags object containing the flags to be set flag, boolean set the flags to this boolean value value)Overrides javax. |
| public synchronized void | setFlags(int
the number of the first message start, int the number of the last message end, Flags Flags object containing the flags to be set flag, boolean set the flags to this boolean value value)Overrides javax. |
| public synchronized void | setFlags(int[]
the array of message numbers msgnums, Flags Flags object containing the flags to be set flag, boolean set the flags to this boolean value value)Overrides javax. |
| public void | |
| public synchronized void | setSubscribed(final boolean
true to subscribe, false to unsubscribe subscribe)Overrides javax. |
| pack-priv boolean | Returns: true if IDLE started, false otherwiseStart the IDLE command and put this folder into the IDLE state. |
| protected synchronized void | throwClosedException(ConnectionException
the ConnectionException cex)Throw the appropriate 'closed' exception. |
| pack-priv void |