Name

UIDFolder

Synopsis

Identifies a JavaMail Folder that supports disconnected (off-net) operation by assigning specific unique identifiers to messages, such as with an IMAP mail server. This allows client programs to save the unique identifier for a particular message and use it to re-retrieve that message during a later session. Unique identifiers are strictly ascending, but not necessarily contiguous.

The getUIDValidity() method is returns a number that can be used to assure that UIDs from earlier sessions are valid. If unique identifiers from an earlier session have not persisted into the current session, this method must return a higher value in the subsequent session.

public interface UIDFolder {
// Public Constants
   public static final long LASTUID;                             // =-1
                  // Inner Classes

           public static class FetchProfileItem extends FetchProfile.Item; 
// Public Instance Methods
   public abstract javax.mail.Message getMessageByUID(
        long uid) throws MessagingException;  
   public abstract javax.mail.Message[] getMessagesByUID(
        long[] uids) throws MessagingException;  
   public abstract javax.mail.Message[] getMessagesByUID(
        long start, long end) throws MessagingException;  
   public abstract long getUID(
        javax.mail.Message message) throws MessagingException;  
   public abstract long getUIDValidity(
        ) throws MessagingException;  
}

Get Java Enterprise in a Nutshell, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.