Package gnu.mail.providers.nntp
Class NNTPStore
- java.lang.Object
-
- javax.mail.Service
-
- javax.mail.Store
-
- gnu.mail.providers.nntp.NNTPStore
-
public class NNTPStore extends Store
An NNTP store provider. This uses an NNTPConnection to handle all the protocol-related functionality.- Version:
- 2.0
- Author:
- Chris Burdess
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Close the connection.Folder
getDefaultFolder()
Returns the folder representing the "root" namespace.Folder
getFolder(java.lang.String name)
Returns a folder by name.Folder
getFolder(URLName url)
Returns the folder whose name corresponds to thefile
part of the specified URL.protected boolean
protocolConnect(java.lang.String host, int port, java.lang.String username, java.lang.String password)
Performs the protocol connection.-
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, isConnected, 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
Performs the protocol connection.- 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
-
close
public void close() throws MessagingException
Close the connection.- Overrides:
close
in classService
- Throws:
MessagingException
-
getDefaultFolder
public Folder getDefaultFolder() throws MessagingException
Returns the folder representing the "root" namespace. This folder can be used to browse the folder hierarchy.- Specified by:
getDefaultFolder
in classStore
- Throws:
MessagingException
-
getFolder
public Folder getFolder(java.lang.String name) throws MessagingException
Returns a folder by name.- Specified by:
getFolder
in classStore
- Parameters:
name
- the folder name- Throws:
MessagingException
-
getFolder
public Folder getFolder(URLName url) throws MessagingException
Returns the folder whose name corresponds to thefile
part of the specified URL.- Specified by:
getFolder
in classStore
- Parameters:
url
- a URLName denoting a folder- Throws:
MessagingException
-
-