james-mime4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From p...@kuruma.co.uk
Subject Re: Upgrading dependency - Code changes
Date Wed, 26 Sep 2018 12:17:57 GMT
Hello all,

Apologies but after examining the source code of the project on github I
can see that the mutators were removed in favour of using a builder
pattern.

For anyone that this might help, an example:

final BodyPartBuilder bodyPartBuilder =
BodyPartBuilder.create().setBody(body);
if (soapAttachment.getTransferEncoding() != null) {								    
bodyPartBuilder.setContentTransferEncoding(soapAttachment.getTransferEncoding().getValue());
}

return bodyPartBuilder.build();

Thanks

On Wed, September 26, 2018 12:14 pm, paul@kuruma.co.uk wrote:

> Hello,
>
>
> I am upgrading a projects dependency on mime4j from 0.7.2 to 0.8.2.
>
>
> In doing so and then running a maven update on the project I can see I
> will have to make some code changes. I cannot easily see what it is that I
>  should be calling now.
>
> The two snippets of code that are failing to compile are:
>
>
> final TextBody body = bodyFactory.textBody(inputStream); final BodyPart
> bodyPart = new BodyPart(); bodyPart.setText(body); // the method setText()
> is no longer available to call
>
> bodyPart.setContentTransferEncoding(codec.getValue()); // The method
> setContentTransferEncoding() is no longer available to call
>
> Any help would be appreciated, this is a part of the system that is
> generally not often touched and I have never worked on it or used Apache
> James Storage myself.
>
>
> Thanks



Mime
View raw message