⇒ Index (Frames) |  ⇒ Index (No Frames) |  ⇒ Package |  ⇒ Package Tree |  ⇒ Full Tree 
gnu.mail.providers.nntp

Class NNTPFolder

java.lang.Object
|
+--javax.mail.Folder
   |
   +--gnu.mail.providers.nntp.NNTPFolder


public final class NNTPFolder
extends Folder

A JavaMail folder delegate for an NNTP newsgroup.
Author:

Method Summary

void

appendMessages(Message messages)

NNTP servers are read-only.

void

close(boolean expunge)

This method has no particular meaning in NNTP.

boolean

create(int type)

NNTP servers are read-only.

boolean

delete(boolean recurse)

NNTP servers are read-only.

boolean

exists()

Indicates whether the newsgroup is present on the server.

Message[]

expunge()

NNTP servers are read-only.

void

fetch(Message msgs, FetchProfile fp)

Prefetch.

Folder

getFolder(String name)

This folder type does not contain other folders.

String

getFullName()

Message

getMessage(int msgnum)

Returns the article corresponding to the specified article number.

int

getMessageCount()

Returns the number of articles in this newsgroup.

Message[]

getMessages()

Returns all articles in this group.

int

getMode()

This folder type is always read-only.

String

getName()

Returns the name of the newsgroup, e.g.

Folder

getParent()

This implementation uses a flat namespace, so the parent of any NNTPFolder is the NNTP root folder.

Flags

getPermanentFlags()

Returns the flags supported by this folder.

char

getSeparator()

If we move away from a flat namespace, this might be useful.

int

getType()

Returns the type of this folder.

boolean

hasNewMessages()

Indicates whether there are new articles in this newsgroup.

boolean

isOpen()

boolean

isSubscribed()

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.

void

open(int mode)

This method has no particular meaning in NNTP.

boolean

renameTo(Folder folder)

NNTP servers are read-only.

void

setSubscribed(boolean flag)

Subscribes or unsubscribes to this newsgroup.

Method Details

appendMessages

public void appendMessages(Message messages)

NNTP servers are read-only.

Parameters:
messages

close

public void close(boolean expunge)

This method has no particular meaning in NNTP.

Parameters:
expunge

create

public boolean create(int type)

NNTP servers are read-only.

Parameters:
type

delete

public boolean delete(boolean recurse)

NNTP servers are read-only.

Parameters:
recurse

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.

Parameters:
msgs
fp

getFolder

public Folder getFolder(String name)

This folder type does not contain other folders.

Parameters:
name

getFullName

public String getFullName()

See Also:
getName

getMessage

public Message getMessage(int msgnum)

Returns the article corresponding to the specified article number.

Parameters:
msgnum
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.

Parameters:
pattern

listSubscribed

public Folder[] listSubscribed(String pattern)

This folder type does not contain other folders.

Parameters:
pattern

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.

Parameters:
mode

renameTo

public boolean renameTo(Folder folder)

NNTP servers are read-only.

Parameters:
folder

setSubscribed

public void setSubscribed(boolean flag)

Subscribes or unsubscribes to this newsgroup. This uses the newsrc mechanism associated with this folder's store.

Parameters:
flag