james-mime4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: Code porting problems from mime4j 0.6.1 to 0.7
Date Sat, 06 Aug 2011 11:31:13 GMT
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


Mime
View raw message