commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chemi <>
Subject Re: [Commons-net NTTP]: Problem getting info of a Newsgroup
Date Fri, 05 Nov 2004 16:22:34 GMT
Sorry. My previous note was not accurate.
When I get the list, I don't see that info in the console (I don't know 
why but it seems the client doesn't select the newsgroup). I see that 
info when I select the newsgroup:

    NNTPClient client = new NNTPClient();
    client.addProtocolCommandListener(new DebugCommandListener(logger));
    client.connect(, this.port);

But the question/problem still the same. Why getArticleCount() returns 1 
if the server said 0.



Chemi wrote:

> Hi, I am getting the list of newsgroups from a NNTP Server (James 
> v2.2.0) with:
>    NNTPClient client = new NNTPClient();
>    client.addProtocolCommandListener(new DebugCommandListener(logger));
>    client.connect(,this.port);
>    NewsgroupInfo[] newsgroupInfo = client.listNewsgroups();
>    ......
> DebugCommandListener is a class which prints in the console all the 
> NNTP Protocol traffic. In my case, I have some newsgroups with zero 
> articles so I see this answer from the server in the console:
>    211 0 0 0 org.apache.james.user group selected
> But when I get the total number of articles with:
>    newsgrouInfo[x].getArticlecount()
> it returns 1. And it should return 0. Right?
> Is this a known bug? Am I missing anything? Reading javadoc 
> information, I see "Get the estimated number of articles in the 
> newsgroup. The accuracy of this value will depend on the server 
> implementation.". But as I said when I print the answer from the 
> server I can see 0 as the number of articles.
> By the way, I am using commons-net 1.2.2
> Thanks in advance,
>    Chemi. 

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message