Hi,

I need to construct a multipart/mixed request with
(a) Set Content-type hdr (along with charset) for individual mime part
(b) Encode filename in the Content-Disposition hdr's using that charset (ex:
for multibyte file names).

Using http-components 4.0, I extended MultiPartEntity
(generateContentType())  to create a request with  multipart/mixed
content-type.
I achieved (a) by extending InputStreamBody to provide getCharset(), mode as
STRICT.

However there seems to be no easy way to achieve (b) as the
content-disposion filename is encoded using the charset only in
BROWSER_COMPATIBLE mode.
Unfortunately, the relevant methods in MultiPartEntity cannot be
overriden/extended as it uses private final instances of HttpMultiPart (and
why ?).

Seems like writing a new class (ex: MultipartMixedEntity) implementing
HttpEntity - which then uses an extended HttpMultipart seem to be the only
solution and this adds a *lot* of redundant code.  And this seems to be no
different wit 4.1 alpha as well


Any other ideas ?

Thanks
Sai

Reply via email to