Package gnu.mail.providers.pop3
Class POP3Store
- java.lang.Object
-
- javax.mail.Service
-
- javax.mail.Store
-
- gnu.mail.providers.pop3.POP3Store
-
public final class POP3Store extends Store
The storage class implementing the POP3 mail protocol.- Version:
- 1.3
- Author:
- Chris Burdess, Nic Ferrier
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Closes the connection.FoldergetDefaultFolder()Returns the root folder.FoldergetFolder(java.lang.String s)Returns the folder with the specified name.FoldergetFolder(URLName urlname)Returns the folder whose name is the file part of the specified URLName.protected javax.net.ssl.TrustManagergetTrustManager()Returns a trust manager used for TLS negotiation.booleanisConnected()Issues a NOOP to the POP server to determine whether the connection is still alive.protected booleanprotocolConnect(java.lang.String host, int port, java.lang.String username, java.lang.String password)Connects to the POP3 server and authenticates with the specified parameters.-
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 port, java.lang.String username, java.lang.String password) throws MessagingExceptionConnects to the POP3 server and authenticates with the specified parameters.- Overrides:
protocolConnectin classService- Parameters:
host- the name of the host to connect toport- the port to use (-1 for the default port)username- the usernamepassword- the password- Returns:
- true on success, false if authentication failed
- Throws:
AuthenticationFailedException- on authentication failureMessagingException- for non-authentication failures
-
getTrustManager
protected javax.net.ssl.TrustManager getTrustManager() throws MessagingExceptionReturns a trust manager used for TLS negotiation.- Throws:
MessagingException
-
close
public void close() throws MessagingExceptionCloses the connection.- Overrides:
closein classService- Throws:
MessagingException
-
isConnected
public boolean isConnected()
Issues a NOOP to the POP server to determine whether the connection is still alive.- Overrides:
isConnectedin classService
-
getDefaultFolder
public Folder getDefaultFolder() throws MessagingException
Returns the root folder.- Specified by:
getDefaultFolderin classStore- Throws:
MessagingException
-
getFolder
public Folder getFolder(java.lang.String s) throws MessagingException
Returns the folder with the specified name.- Specified by:
getFolderin classStore- Parameters:
s- the folder name- Throws:
MessagingException
-
getFolder
public Folder getFolder(URLName urlname) throws MessagingException
Returns the folder whose name is the file part of the specified URLName.- Specified by:
getFolderin classStore- Parameters:
urlname- a URLName denoting a folder- Throws:
MessagingException
-
-