Re: Getting only latest X messages of a newsgroup
Cedric Hyppolite <[email protected]> Sun, 30 Jul 2006 17:26:28 +0200
| Newsgroups | gmane.comp.java.classpath.extensions.discuss |
|---|---|
| Message-ID | <[email protected]> |
Hi Chris, I see two ways: - Get at most X latest articles: fetching the message headers using =20 (last - X) or first -> last as the range in NNTPFolder.getMessages() - Get exactly the X latest articles: fetching the message headers =20 using first -> last and keeping only the latest X messages Either way, the internal cache is used to prevent queries for =20 previously downloaded messages. Once the getMessages() returned the array of X recent messages, their =20= full content can be downloaded using fetch(Message[], FetchProfile) There would be one property (for example 'mail.nntp.limittolatest' ) =20 that states the number of messages to download at most or exactly. This property should be read each time before being used so that a =20 client could change the value before fetching each newsgroup. C=C3=A9dric Le 30 juil. 06 =C3=A0 09:41, Chris Burdess a =C3=A9crit : > Cedric Hyppolite wrote: >> I am trying to find a way to download only the latest post to a =20 >> newsgroup. >> Is there a way to do this with the current API ? > > As far as I can see there isn't a way to do this with the JavaMail =20 > API. You can do it pretty easily with the inetlib interface. > > If you have any suggestions as to how this might be implemented =20 > using property extensions to the JavaMail nntp provider we could =20 > look at that. > --=20 > =E7=8A=AC Chris Burdess > "They that can give up essential liberty to obtain a little safety > deserve neither liberty nor safety." - Benjamin Franklin > > > >