Class GmailProtocol


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

    • MSGID_ITEM

      public static final FetchItem MSGID_ITEM
    • THRID_ITEM

      public static final FetchItem THRID_ITEM
    • LABELS_ITEM

      public static final FetchItem LABELS_ITEM
  • Constructor Details

    • GmailProtocol

      public GmailProtocol(String name, String host, int port, Properties props, boolean isSSL, MailLogger logger) throws 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:
      IOException - for I/O errors
      ProtocolException - for protocol failures
  • Method Details

    • 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, 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, 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, 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
    • getSearchSequence

      protected SearchSequence getSearchSequence()
      Return a GmailSearchSequence.
      Overrides:
      getSearchSequence in class IMAPProtocol
      Returns:
      the SearchSequence