You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mime4j-dev@james.apache.org by "Sharma, Ashish" <as...@hp.com> on 2011/08/05 15:43:45 UTC
Code porting problems from mime4j 0.6.1 to 0.7
Hi,
I am trying to port my code from mime4j 0.6.1 to 0.7.
I am stuck at following:
MimeEntityConfig mime4jParserConfig = new MimeEntityConfig ();
mime4jParserConfig.setMaximalBodyDescriptor(true);
MimeStreamParser mime4jParser = new MimeStreamParser(mime4jParserConfig);
mime4jParser.setContentDecoding(true);
mime4jParser.setContentHandler(contentHandler);
In the above 'MimeEntityConfig' has been changed to 'MimeConfig' but the method 'setMaximalBodyDescriptor(Boolean)' is missing in the new config class.
Actually I want BodyDescriptor to be instances of 'MaximalBodyDescriptor'
Can anyone suggest me any alternative?
Thanks
Ashish
Re: Code porting problems from mime4j 0.6.1 to 0.7
Posted by Oleg Kalnichevski <ol...@apache.org>.
On Fri, 2011-08-05 at 14:43 +0100, Sharma, Ashish wrote:
> Hi,
>
> I am trying to port my code from mime4j 0.6.1 to 0.7.
>
> I am stuck at following:
>
>
> MimeEntityConfig mime4jParserConfig = new MimeEntityConfig ();
> mime4jParserConfig.setMaximalBodyDescriptor(true);
>
> MimeStreamParser mime4jParser = new MimeStreamParser(mime4jParserConfig);
> mime4jParser.setContentDecoding(true);
> mime4jParser.setContentHandler(contentHandler);
>
>
> In the above 'MimeEntityConfig' has been changed to 'MimeConfig' but the method 'setMaximalBodyDescriptor(Boolean)' is missing in the new config class.
>
> Actually I want BodyDescriptor to be instances of 'MaximalBodyDescriptor'
>
> Can anyone suggest me any alternative?
>
This should do the trick
MimeConfig config = new MimeConfig();
MimeStreamParser mime4jParser = new MimeStreamParser(config,
DecodeMonitor.SILENT,
new DefaultBodyDescriptorBuilder());
mime4jParser.setContentDecoding(true);
mime4jParser.setContentHandler(contentHandler);
Oleg