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 void
close()
Closes the connection.Folder
getDefaultFolder()
Returns the root folder.Folder
getFolder(java.lang.String s)
Returns the folder with the specified name.Folder
getFolder(URLName urlname)
Returns the folder whose name is the file part of the specified URLName.protected javax.net.ssl.TrustManager
getTrustManager()
Returns a trust manager used for TLS negotiation.boolean
isConnected()
Issues a NOOP to the POP server to determine whether the connection is still alive.protected boolean
protocolConnect(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 MessagingException
Connects to the POP3 server and authenticates with the specified parameters.- Overrides:
protocolConnect
in 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 MessagingException
Returns a trust manager used for TLS negotiation.- Throws:
MessagingException
-
close
public void close() throws MessagingException
Closes the connection.- Overrides:
close
in classService
- Throws:
MessagingException
-
isConnected
public boolean isConnected()
Issues a NOOP to the POP server to determine whether the connection is still alive.- Overrides:
isConnected
in classService
-
getDefaultFolder
public Folder getDefaultFolder() throws MessagingException
Returns the root folder.- Specified by:
getDefaultFolder
in classStore
- Throws:
MessagingException
-
getFolder
public Folder getFolder(java.lang.String s) throws MessagingException
Returns the folder with the specified name.- Specified by:
getFolder
in 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:
getFolder
in classStore
- Parameters:
urlname
- a URLName denoting a folder- Throws:
MessagingException
-
-