Class MultipartMessage
java.lang.Object
org.apache.james.mime4j.samples.dom.MultipartMessage
Creates a multipart/mixed message that consists of a text/plain and an
image/png part. The image is created on the fly; a similar technique can be
used to create PDF or XML attachments, for example.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static BinaryBody
createImageBody
(StorageBodyFactory bodyFactory, BufferedImage image) Creates a binary part from the specified image.static void
private static BufferedImage
Draws an image; unrelated to Mime4j.private static Storage
storeImage
(StorageProvider storageProvider, BufferedImage image, String formatName) Stores the specified image in a Storage object.
-
Constructor Details
-
MultipartMessage
public MultipartMessage()
-
-
Method Details
-
main
- Throws:
Exception
-
createImageBody
private static BinaryBody createImageBody(StorageBodyFactory bodyFactory, BufferedImage image) throws IOException Creates a binary part from the specified image.- Throws:
IOException
-
storeImage
private static Storage storeImage(StorageProvider storageProvider, BufferedImage image, String formatName) throws IOException Stores the specified image in a Storage object.- Throws:
IOException
-
renderSampleImage
Draws an image; unrelated to Mime4j.
-