commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Penning" <>
Subject NNTP Client -> identical headers?
Date Wed, 03 Dec 2008 17:12:57 GMT


I am trying to implement a nntp header parser with Jakarta Commons Net.
The authentication and receiving of groups works well but I got strange
results when I am trying to download a huge number (100.000) of article
HEADER in a binary group.

There are a lot of headers (approx. 10-20% which are identical in
subject, author and group. Only the size / header number / messageID
differs somewhat.

Why could this happen?


My source code to receive the header: (client is an open and authed


                  ArrayList<Header> headers = new ArrayList<Header>();

                  DotTerminatedMessageReader reader =


                  BufferedReader stringReader = new

                  String line = null;

                  String[] header = new String[6];

                  while((line = stringReader.readLine()) != null)




                             header = line.split("\t");

                             int number = Integer.parseInt(header[0]);

                             String subject = header[1];

                             String author = header[2];

                             Date date = this.parseDate(header[3]);

                             String messageID = header[4];

                             int size = Integer.parseInt(header[6]);

                             headers.add(new Header(number, subject,
author, date.getTime()/1000, size, messageID, parser));


                        catch (Exception e)


                             // exception handling...




Now I am sorting my header-objects and finally got a lot of duplicates,
as described.

Is there any mistake in my code?


Kind regards, D.Penning



  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message