protected BodyPart handleBinaryPart ( MimePart mediaPart , String contentType ) throws IOException , MessagingException { String contentId = mediaPart . getContentID ( ) != null ? "(" + mediaPart . getContentID ( ) + ")" : "" ; return new BodyPart ( mediaPart . getFileName ( ) + contentId , contentType ) ; }
Construct simple body part from binary data just adding file name as content .