All Implemented Interfaces:
QuotaAwareStore, AutoCloseable, org.eclipse.angus.mail.iap.ResponseHandler
Direct Known Subclasses:
GmailSSLStore

public class GmailStore extends IMAPStore
A Gmail Store. Defaults to imap.gmail.com with SSL. Uses a GmailProtocol and Gmail Folder to support Gmail extensions.
Since:
JavaMail 1.4.6
  • Constructor Details

    • GmailStore

      public GmailStore(Session session, URLName url)
      Constructor that takes a Session object and a URLName that represents a specific IMAP server.
      Parameters:
      session - the Session
      url - the URLName of this store
    • GmailStore

      protected GmailStore(Session session, URLName url, String name, boolean isSSL)
      Constructor used by GmailSSLStore subclass.
      Parameters:
      session - the Session
      url - the URLName of this store
      name - the protocol name
      isSSL - use SSL to connect?
  • Method Details

    • protocolConnect

      protected boolean protocolConnect(String host, int pport, String user, String password) throws MessagingException
      Description copied from class: IMAPStore
      Implementation of protocolConnect(). Will create a connection to the server and authenticate the user using the mechanisms specified by various properties.

      The host, user, and password parameters must all be non-null. If the authentication mechanism being used does not require a password, an empty string or other suitable dummy password should be used.

      Overrides:
      protocolConnect in class IMAPStore
      Parameters:
      host - the name of the host to connect to
      pport - the port to use (-1 means use default port)
      user - the name of the user to login as
      password - the user's password
      Returns:
      true if connection successful, false if authentication failed
      Throws:
      AuthenticationFailedException - for authentication failures
      MessagingException - for non-authentication failures
    • newIMAPProtocol

      protected org.eclipse.angus.mail.imap.protocol.IMAPProtocol newIMAPProtocol(String host, int port) throws IOException, org.eclipse.angus.mail.iap.ProtocolException
      Description copied from class: IMAPStore
      Create an IMAPProtocol object connected to the host and port. Subclasses of IMAPStore may override this method to return a subclass of IMAPProtocol that supports product-specific extensions.
      Overrides:
      newIMAPProtocol in class IMAPStore
      Parameters:
      host - the host name
      port - the port number
      Returns:
      the new IMAPProtocol object
      Throws:
      IOException - for I/O errors
      org.eclipse.angus.mail.iap.ProtocolException - for protocol errors
    • newIMAPFolder

      protected IMAPFolder newIMAPFolder(String fullName, char separator, Boolean isNamespace)
      Create an IMAPFolder object.
      Overrides:
      newIMAPFolder in class IMAPStore
      Parameters:
      fullName - the full name of the folder
      separator - the separator character for the folder hierarchy
      isNamespace - does this name represent a namespace?
      Returns:
      the new IMAPFolder object
    • newIMAPFolder

      protected IMAPFolder newIMAPFolder(org.eclipse.angus.mail.imap.protocol.ListInfo li)
      Create an IMAPFolder object.
      Overrides:
      newIMAPFolder in class IMAPStore
      Parameters:
      li - the ListInfo for the folder
      Returns:
      the new IMAPFolder object