|
From: | Cedric Hyppolite |
Subject: | Re: [Classpathx-discuss] Getting only latest X messages of a newsgroup |
Date: | Sun, 30 Jul 2006 17:26:28 +0200 |
Hi Chris, I see two ways:- Get at most X latest articles: fetching the message headers using (last - X) or first -> last as the range in NNTPFolder.getMessages()
- Get exactly the X latest articles: fetching the message headers using first -> last and keeping only the latest X messages
Either way, the internal cache is used to prevent queries for previously downloaded messages. Once the getMessages() returned the array of X recent messages, their full content can be downloaded using fetch(Message[], FetchProfile)
There would be one property (for example 'mail.nntp.limittolatest' ) 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 client could change the value before fetching each newsgroup.
Cédric Le 30 juil. 06 à 09:41, Chris Burdess a écrit :
Cedric Hyppolite wrote:I am trying to find a way to download only the latest post to a 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 API. You can do it pretty easily with the inetlib interface.If you have any suggestions as to how this might be implemented using property extensions to the JavaMail nntp provider we could look at that.-- 犬 Chris Burdess "They that can give up essential liberty to obtain a little safety deserve neither liberty nor safety." - Benjamin Franklin
[Prev in Thread] | Current Thread | [Next in Thread] |