com.sun.mail.gimap

## Class GmailStore

- java.lang.Object
- - javax.mail.Service
  - - javax.mail.Store
    - - com.sun.mail.imap.IMAPStore
      - - com.sun.mail.gimap.GmailStore

- All Implemented Interfaces:
    ResponseHandler, QuotaAwareStore
  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

- - ### Field Summary

    - ### Fields inherited from class com.sun.mail.imap.IMAPStore

      `authorizationID, defaultPort, host, isSSL, logger, name, password, proxyAuthUser, RESPONSE, saslRealm, user`

    - ### Fields inherited from class javax.mail.Service

      `debug, session, url`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `` | `GmailStore(Session session, URLName url)` Constructor that takes a Session object and a URLName that represents a specific IMAP server.
    `protected` | `GmailStore(Session session, URLName url, String name, boolean isSSL)` Constructor used by GmailSSLStore subclass.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected IMAPFolder` | `newIMAPFolder(ListInfo li)` Create an IMAPFolder object.
    `protected IMAPFolder` | `newIMAPFolder(String fullName, char separator, Boolean isNamespace)` Create an IMAPFolder object.
    `protected IMAPProtocol` | `newIMAPProtocol(String host, int port)` Create an IMAPProtocol object connected to the host and port.
    `protected boolean` | `protocolConnect(String host, int pport, String user, String password)` Implementation of protocolConnect().

    - ### Methods inherited from class com.sun.mail.imap.IMAPStore

      `close, finalize, getDefaultFolder, getFolder, getFolder, getPersonalNamespaces, getQuota, getSharedNamespaces, getUserNamespaces, handleResponse, hasCapability, idle, isConnected, isSSL, newIMAPFolder, preLogin, setPassword, setQuota, setUsername`

    - ### Methods inherited from class javax.mail.Store

      `addFolderListener, addStoreListener, notifyFolderListeners, notifyFolderRenamedListeners, notifyStoreListeners, removeFolderListener, removeStoreListener`

    - ### Methods inherited from class javax.mail.Service

      `addConnectionListener, connect, connect, connect, connect, getURLName, notifyConnectionListeners, queueEvent, removeConnectionListener, setConnected, setURLName, toString`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### GmailStore

          public GmailStore(Session session,
                    URLName url)

      Constructor that takes a Session object and a URLName that represents a specific IMAP server.

    - #### GmailStore

          protected GmailStore(Session session,
                    URLName url,
                    String name,
                    boolean isSSL)

      Constructor used by GmailSSLStore subclass.

  - ### Method Detail

    - #### 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 IMAPProtocol newIMAPProtocol(String host,
                                     int port)
                                          throws IOException,
                                                 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`
      Throws:
        `IOException`
        `ProtocolException`

    - #### newIMAPFolder

          protected IMAPFolder newIMAPFolder(String fullName,
                                 char separator,
                                 Boolean isNamespace)

      Create an IMAPFolder object.
      Overrides:
        `newIMAPFolder` in class `IMAPStore`

    - #### newIMAPFolder

          protected IMAPFolder newIMAPFolder(ListInfo li)

      Create an IMAPFolder object.
      Overrides:
        `newIMAPFolder` in class `IMAPStore`

Copyright © 2013 Oracle. All Rights Reserved.