Discussion:
[Classpathx-javamail] MimeBodyPart.saveFile() troubles
foo
2007-07-16 04:59:28 UTC
Permalink
Hi, I am using the MimeBodyPart.saveFile(File) method. It seems that when I
use this on a Base64-encoded body part, that it would save a file with the
Base64 encoding, instead of decoding it to the original data.

I also found that if I comment out the following line in the method, that it
would save the file with the correctly decoded data:
//out = MimeUtility.encode(out, getEncoding());

And it indeed seems that this line is counterproductive, because (pardon if
I am wrong) this line re-encodes back into Base64 the decoded data that is
sent to "out" by the rest of the method.

I am using the Debian package libgnumail-java 1.1.2-2.

Thanks,
Chris Burdess
2007-07-16 18:07:04 UTC
Permalink
Post by foo
Hi, I am using the MimeBodyPart.saveFile(File) method. It seems that when I
use this on a Base64-encoded body part, that it would save a file with the
Base64 encoding, instead of decoding it to the original data.
I also found that if I comment out the following line in the method, that
//out = MimeUtility.encode(out, getEncoding());
And it indeed seems that this line is counterproductive, because (pardon if
I am wrong) this line re-encodes back into Base64 the decoded data that is
sent to "out" by the rest of the method.
I agree that it is counterintuitive to save it in the original encoding.
I've changed it not to re-encode it for saveFile in HEAD. Thanks for the
feedback.
--
Chris Burdess
Loading...