Hi Rory, I'm not sure if the header values are correct ;) I'm only wondering why there are so much headers which are - as described - nearly identical in their values. Is my way to parse the Stream into different headers a common way to do this job?
Thanks a lot, Daniel -----Ursprüngliche Nachricht----- Von: Rory Winston [mailto:[EMAIL PROTECTED] Gesendet: Mittwoch, 3. Dezember 2008 23:12 An: Commons Users List Betreff: Re: NNTP Client -> identical headers? Hi Daniel I'm not quite sure what the problem is here - are you saying that the header values are incorrect for large article retrievals? Rory Daniel Penning wrote: > Hello, > > > > 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 > nntp-Client) > > > > ArrayList<Header> headers = new ArrayList<Header>(); > > DotTerminatedMessageReader reader = > (DotTerminatedMessageReader) > > client.retrieveArticleInfo((int)rangeFrom, > (int)rangeTo); > > BufferedReader stringReader = new > BufferedReader(reader); > > String line = null; > > String[] header = new String[6]; > > while((line = stringReader.readLine()) != null) > > { > > try > > { > > 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 > > > > > > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
