Class GmailProtocol


  • public class GmailProtocol
    extends IMAPProtocol
    Extend IMAP support to handle Gmail-specific protocol extensions.
    Since:
    JavaMail 1.4.6
    • Field Detail

      • MSGID_ITEM

        public static final FetchItem MSGID_ITEM
      • THRID_ITEM

        public static final FetchItem THRID_ITEM
      • LABELS_ITEM

        public static final FetchItem LABELS_ITEM
      • myFetchItems

        private static final FetchItem[] myFetchItems
    • Constructor Detail

      • GmailProtocol

        public GmailProtocol​(java.lang.String name,
                             java.lang.String host,
                             int port,
                             java.util.Properties props,
                             boolean isSSL,
                             MailLogger logger)
                      throws java.io.IOException,
                             ProtocolException
        Connect to Gmail.
        Parameters:
        name - the protocol name
        host - host to connect to
        port - portnumber to connect to
        props - Properties object used by this protocol
        isSSL - use SSL?
        logger - for log messages
        Throws:
        java.io.IOException - for I/O errors
        ProtocolException - for protocol failures
    • Method Detail

      • getFetchItems

        public FetchItem[] getFetchItems()
        Return the additional fetch items supported by the Gmail protocol. Combines our fetch items with those supported by the superclass.
        Overrides:
        getFetchItems in class IMAPProtocol
        Returns:
        an array of FetchItem objects
      • storeLabels

        public void storeLabels​(MessageSet[] msgsets,
                                java.lang.String[] labels,
                                boolean set)
                         throws ProtocolException
        Set the specified labels on this message.
        Parameters:
        msgsets - the message sets
        labels - the labels
        set - true to set, false to clear
        Throws:
        ProtocolException - for protocol failures
        Since:
        JavaMail 1.5.5
      • storeLabels

        public void storeLabels​(int start,
                                int end,
                                java.lang.String[] labels,
                                boolean set)
                         throws ProtocolException
        Set the specified labels on this message.
        Parameters:
        start - the first message number
        end - the last message number
        labels - the labels
        set - true to set, false to clear
        Throws:
        ProtocolException - for protocol failures
        Since:
        JavaMail 1.5.5
      • storeLabels

        public void storeLabels​(int msg,
                                java.lang.String[] labels,
                                boolean set)
                         throws ProtocolException
        Set the specified labels on this message.
        Parameters:
        msg - the message number
        labels - the labels
        set - true to set, false to clear
        Throws:
        ProtocolException - for protocol failures
        Since:
        JavaMail 1.5.5
      • createLabelList

        private Argument createLabelList​(java.lang.String[] labels)