- java.lang.Object
-
- javax.mail.Service
-
- javax.mail.Store
-
- com.sun.mail.pop3.POP3Store
-
- All Implemented Interfaces:
java.lang.AutoCloseable
- Direct Known Subclasses:
POP3SSLStore
public class POP3Store extends 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.- Author:
- Bill Shannon, John Mani
-
-
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.voidclose()protected voidfinalize()FoldergetDefaultFolder()FoldergetFolder(java.lang.String name)Only the name "INBOX" is supported.FoldergetFolder(URLName url)booleanisConnected()Check whether this store is connected.booleanisSSL()Is this POP3Store using SSL to connect to the server?protected booleanprotocolConnect(java.lang.String host, int portNum, java.lang.String user, java.lang.String passwd)-
Methods inherited from class javax.mail.Store
addFolderListener, addStoreListener, getPersonalNamespaces, getSharedNamespaces, getUserNamespaces, notifyFolderListeners, notifyFolderRenamedListeners, notifyStoreListeners, removeFolderListener, removeStoreListener
-
Methods inherited from class javax.mail.Service
addConnectionListener, connect, connect, connect, connect, getURLName, notifyConnectionListeners, queueEvent, removeConnectionListener, setConnected, setURLName, toString
-
-
-
-
Method Detail
-
protocolConnect
protected boolean protocolConnect(java.lang.String host, int portNum, java.lang.String user, java.lang.String passwd) throws MessagingException- Overrides:
protocolConnectin classService- Throws:
MessagingException
-
isConnected
public boolean isConnected()
Check whether this store is connected. Override superclass method, to actually ping our server connection.- Overrides:
isConnectedin classService
-
close
public void close() throws MessagingException- Specified by:
closein interfacejava.lang.AutoCloseable- Overrides:
closein classService- Throws:
MessagingException
-
getDefaultFolder
public Folder getDefaultFolder() throws MessagingException
- Specified by:
getDefaultFolderin classStore- Throws:
MessagingException
-
getFolder
public Folder getFolder(java.lang.String name) throws MessagingException
Only the name "INBOX" is supported.- Specified by:
getFolderin classStore- Throws:
MessagingException
-
getFolder
public Folder getFolder(URLName url) throws MessagingException
- Specified by:
getFolderin classStore- Throws:
MessagingException
-
capabilities
public java.util.Map<java.lang.String,java.lang.String> capabilities() throws MessagingExceptionReturn 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:
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
-
-