Package javax.mail
Interface UIDFolder
-
- All Known Implementing Classes:
IMAPFolder
public interface UIDFolderA folder that supports permanent references to messages in the form of a long integer (i.e. an IMAP folder). These UIDs survive the closure and reopening of the message store and session context.UIDs are assigned to messages in a folder in a strictly ascending fashion; that is, if the message number of message x is greater than the message number of message y, its UID will also be greater than that of y.
- Version:
- 1.4
- Author:
- Chris Burdess
- See Also:
2060 http://www.ietf.org/rfc/rfc2060.txt
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classUIDFolder.FetchProfileItemA fetch profile item for fetching UIDs.
-
Field Summary
Fields Modifier and Type Field Description static longLASTUIDThis special value can be used as the end parameter ingetMessages(start, end)to denote the last UID in this folder.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description MessagegetMessageByUID(long uid)Returns the message corresponding to the given UID, ornullif no such message exists.Message[]getMessagesByUID(long[] uids)Returns the messages specified by the given UIDs.Message[]getMessagesByUID(long start, long end)Returns the messages in the given range.longgetUID(Message message)Returns the UID for the specified message.longgetUIDValidity()Returns the UIDValidity value associated with this folder.
-
-
-
Field Detail
-
LASTUID
static final long LASTUID
This special value can be used as the end parameter ingetMessages(start, end)to denote the last UID in this folder.- See Also:
- Constant Field Values
-
-
Method Detail
-
getUIDValidity
long getUIDValidity() throws MessagingExceptionReturns the UIDValidity value associated with this folder.A client should compare this value against a UIDValidity value saved from a previous session to ensure that any cached UIDs are valid.
- Throws:
MessagingException
-
getMessageByUID
Message getMessageByUID(long uid) throws MessagingException
Returns the message corresponding to the given UID, ornullif no such message exists.- Parameters:
uid- the UID of the desired message- Throws:
MessagingException
-
getMessagesByUID
Message[] getMessagesByUID(long start, long end) throws MessagingException
Returns the messages in the given range. The special value LASTUID can be used as theendparameter to indicate the last available UID.- Parameters:
start- the start UIDend- the end UID- Throws:
MessagingException
-
getMessagesByUID
Message[] getMessagesByUID(long[] uids) throws MessagingException
Returns the messages specified by the given UIDs. If any UID is invalid,nullis returned for that entry.The returned array will be of the same size as the specified UIDs.
- Parameters:
uids- the UIDs- Throws:
MessagingException
-
getUID
long getUID(Message message) throws MessagingException
Returns the UID for the specified message.- Parameters:
message- a message in this folder- Throws:
java.util.NoSuchElementException- if the given message is not in this folderMessagingException
-
-