Module com.sun.mail

Class POP3Store

  • All Implemented Interfaces:
    java.lang.AutoCloseable
    Direct Known Subclasses:
    POP3SSLStore

    public class POP3Store
    extends jakarta.mail.Store
    A POP3 Message Store. Contains only one folder, "INBOX". See the com.sun.mail.pop3 package documentation for further information on the POP3 protocol provider.

    • Field Summary

      • Fields inherited from class jakarta.mail.Service

        debug, session, url
    • Constructor Summary

      Constructors 
      Constructor Description
      POP3Store​(jakarta.mail.Session session, jakarta.mail.URLName url)  
      POP3Store​(jakarta.mail.Session session, jakarta.mail.URLName url, java.lang.String name, boolean isSSL)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Map<java.lang.String,​java.lang.String> capabilities()
      Return a Map of the capabilities the server provided, as per RFC 2449.
      void close()  
      protected void finalize()  
      jakarta.mail.Folder getDefaultFolder()  
      jakarta.mail.Folder getFolder​(jakarta.mail.URLName url)  
      jakarta.mail.Folder getFolder​(java.lang.String name)
      Only the name "INBOX" is supported.
      boolean isConnected()
      Check whether this store is connected.
      boolean isSSL()
      Is this POP3Store using SSL to connect to the server?
      protected boolean protocolConnect​(java.lang.String host, int portNum, java.lang.String user, java.lang.String passwd)  
      • Methods inherited from class jakarta.mail.Store

        addFolderListener, addStoreListener, getPersonalNamespaces, getSharedNamespaces, getUserNamespaces, notifyFolderListeners, notifyFolderRenamedListeners, notifyStoreListeners, removeFolderListener, removeStoreListener
      • Methods inherited from class jakarta.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

      • POP3Store

        public POP3Store​(jakarta.mail.Session session,
                         jakarta.mail.URLName url)
      • POP3Store

        public POP3Store​(jakarta.mail.Session session,
                         jakarta.mail.URLName url,
                         java.lang.String name,
                         boolean isSSL)
    • Method Detail

      • protocolConnect

        protected boolean protocolConnect​(java.lang.String host,
                                          int portNum,
                                          java.lang.String user,
                                          java.lang.String passwd)
                                   throws jakarta.mail.MessagingException
        Overrides:
        protocolConnect in class jakarta.mail.Service
        Throws:
        jakarta.mail.MessagingException
      • isConnected

        public boolean isConnected()
        Check whether this store is connected. Override superclass method, to actually ping our server connection.
        Overrides:
        isConnected in class jakarta.mail.Service
      • close

        public void close()
                   throws jakarta.mail.MessagingException
        Specified by:
        close in interface java.lang.AutoCloseable
        Overrides:
        close in class jakarta.mail.Service
        Throws:
        jakarta.mail.MessagingException
      • getDefaultFolder

        public jakarta.mail.Folder getDefaultFolder()
                                             throws jakarta.mail.MessagingException
        Specified by:
        getDefaultFolder in class jakarta.mail.Store
        Throws:
        jakarta.mail.MessagingException
      • getFolder

        public jakarta.mail.Folder getFolder​(java.lang.String name)
                                      throws jakarta.mail.MessagingException
        Only the name "INBOX" is supported.
        Specified by:
        getFolder in class jakarta.mail.Store
        Throws:
        jakarta.mail.MessagingException
      • getFolder

        public jakarta.mail.Folder getFolder​(jakarta.mail.URLName url)
                                      throws jakarta.mail.MessagingException
        Specified by:
        getFolder in class jakarta.mail.Store
        Throws:
        jakarta.mail.MessagingException
      • capabilities

        public java.util.Map<java.lang.String,​java.lang.String> capabilities()
                                                                            throws jakarta.mail.MessagingException
        Return a Map of the capabilities the server provided, as per RFC 2449. If the server doesn't support RFC 2449, an emtpy Map is returned. The returned Map can not be modified. The key to the Map is the upper case capability name as a String. The value of the entry is the entire String capability line returned by the server.

        For example, to check if the server supports the STLS capability, use: if (store.capabilities().containsKey("STLS")) ...

        Returns:
        Map of capabilities
        Throws:
        jakarta.mail.MessagingException - for failures
        Since:
        JavaMail 1.4.3
      • isSSL

        public boolean isSSL()
        Is this POP3Store using SSL to connect to the server?
        Returns:
        true if using SSL
        Since:
        JavaMail 1.4.6
      • finalize

        protected void finalize()
                         throws java.lang.Throwable
        Overrides:
        finalize in class jakarta.mail.Service
        Throws:
        java.lang.Throwable