gnu.mail.providers.nntp

Class NNTPFolder

public final class NNTPFolder extends Folder

A JavaMail folder delegate for an NNTP newsgroup.

Version: 2.0

Author: Chris Burdess

Method Summary
voidappendMessages(Message[] messages)
NNTP servers are read-only.
voidclose(boolean expunge)
This method has no particular meaning in NNTP.
booleancreate(int type)
NNTP servers are read-only.
booleandelete(boolean recurse)
NNTP servers are read-only.
booleanexists()
Indicates whether the newsgroup is present on the server.
Message[]expunge()
NNTP servers are read-only.
voidfetch(Message[] msgs, FetchProfile fp)
Prefetch.
FoldergetFolder(String name)
This folder type does not contain other folders.
StringgetFullName()
MessagegetMessage(int msgnum)
Returns the article corresponding to the specified article number.
intgetMessageCount()
Returns the number of articles in this newsgroup.
Message[]getMessages()
Returns all articles in this group.
intgetMode()
This folder type is always read-only.
StringgetName()
Returns the name of the newsgroup, e.g.
FoldergetParent()
This implementation uses a flat namespace, so the parent of any NNTPFolder is the NNTP root folder.
FlagsgetPermanentFlags()
Returns the flags supported by this folder.
chargetSeparator()
If we move away from a flat namespace, this might be useful.
intgetType()
Returns the type of this folder.
booleanhasNewMessages()
Indicates whether there are new articles in this newsgroup.
booleanisOpen()
booleanisSubscribed()
Indicates if the newsgroup is subscribed.
Folder[]list(String pattern)
This folder type does not contain other folders.
Folder[]listSubscribed(String pattern)
This folder type does not contain other folders.
voidopen(int mode)
This method has no particular meaning in NNTP.
booleanrenameTo(Folder folder)
NNTP servers are read-only.
voidsetSubscribed(boolean flag)
Subscribes or unsubscribes to this newsgroup.

Method Detail

appendMessages

public void appendMessages(Message[] messages)
NNTP servers are read-only.

close

public void close(boolean expunge)
This method has no particular meaning in NNTP.

create

public boolean create(int type)
NNTP servers are read-only.

delete

public boolean delete(boolean recurse)
NNTP servers are read-only.

exists

public boolean exists()
Indicates whether the newsgroup is present on the server.

expunge

public Message[] expunge()
NNTP servers are read-only.

fetch

public void fetch(Message[] msgs, FetchProfile fp)
Prefetch.

getFolder

public Folder getFolder(String name)
This folder type does not contain other folders.

getFullName

public String getFullName()

See Also: NNTPFolder

getMessage

public Message getMessage(int msgnum)
Returns the article corresponding to the specified article number.

Throws: MessageRemovedException often ;-)

getMessageCount

public int getMessageCount()
Returns the number of articles in this newsgroup.

getMessages

public Message[] getMessages()
Returns all articles in this group. This tries XHDR first to retrieve Message-IDs for the articles. If this fails we fall back to statting each article.

getMode

public int getMode()
This folder type is always read-only.

getName

public String getName()
Returns the name of the newsgroup, e.g. alt.test.

getParent

public Folder getParent()
This implementation uses a flat namespace, so the parent of any NNTPFolder is the NNTP root folder.

getPermanentFlags

public Flags getPermanentFlags()
Returns the flags supported by this folder.

getSeparator

public char getSeparator()
If we move away from a flat namespace, this might be useful.

getType

public int getType()
Returns the type of this folder. This folder type only holds messages.

hasNewMessages

public boolean hasNewMessages()
Indicates whether there are new articles in this newsgroup.

isOpen

public boolean isOpen()

isSubscribed

public boolean isSubscribed()
Indicates if the newsgroup is subscribed. This uses the newsrc mechanism associated with this folder's store.

list

public Folder[] list(String pattern)
This folder type does not contain other folders.

listSubscribed

public Folder[] listSubscribed(String pattern)
This folder type does not contain other folders.

open

public void open(int mode)
This method has no particular meaning in NNTP. However, we will use it to send a GROUP command and refresh our article stats.

renameTo

public boolean renameTo(Folder folder)
NNTP servers are read-only.

setSubscribed

public void setSubscribed(boolean flag)
Subscribes or unsubscribes to this newsgroup. This uses the newsrc mechanism associated with this folder's store.
© Copyright 2003, 2004 The Free Software Foundation, All rights reserved