Re: how to get a list of available groups
Chris Burdess <[email protected]>
| Newsgroups | gmane.comp.java.classpath.extensions.javamail |
|---|---|
| Message-ID | <[email protected]> |
Ron Smits wrote:
> I am currently playing with the nntp provider. After making a
> connection
> and selecting the defaultFolder there seems to be no way to get a list
> of all the groups available on the server.
>
> Running the following
> Folder root= store.getDefaultFolder();
> root.open(Folder.READ_ONLY);
> Folder t[] = root.list();
> System.out.println ("found " + t.length + " folders");
>
> the output will show:
> nntp: <200 news.xs4all.nl NNRP Service Ready (posting ok).
> nntp: >LIST SUBSCRIPTIONS
> nntp: <215 Subscriptions in form "group"
> nntp: <.
> found 0 folders
>
>
> According to the code list should have thrown an exception. But that
> never arrived.
>
> any ideas?
From the documentation:
mail.nntp.listall
If set to true, calling Folder.list on the root folder will
actually attempt to list all newsgroups. Since there are upwards of
30,000
newsgroups on Usenet, this option should be used with caution.
Otherwise a
small subset of default newsgroups are returned.
It looks like your news server doesn't return such a useful subset.
Note that the nntp provider doesn't create a .newsrc by itself: you
need to create one yourself, and the nntp provider will update it with
subscribed newsgroups and read articles.
--
Chris Burdess