james-mime4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Florent Georges <li...@fgeorges.org>
Subject Re: Parsing header bug?
Date Mon, 28 Dec 2009 13:55:26 GMT
Stefano Bagnara wrote:

> > It is a bit chaotic, and we're trying to decide how to expose
> > header parsing. ATM you can access some parsing via Fields
> > object and some other parsing via AbstractField.parse method
> > (or, as we are going to remove this, I suggest you to
> > instantiate a DefaultFieldParser class).

  Thanks for those details.

  I've tried to use a DefaultFieldParser (by instantiating it
using its default ctor) and its parse() method, but the resulting
field body still returns the extra space in front of the body.

  If I use AbstractField.parse(), then for some headers that
works (there is no space anymore in front of the body) but for
other fields, it leads to an NPE:

    Field f = ...;
    LOG.warn("FIELD RAW: " + f.getRaw());
    AbstractField.parse(f.getRaw());         // line 188

[WARN] MultipartResponseBody - FIELD RAW: Content-length: 206

  I am not sure to use this API the right way though...


Florent Georges


View raw message