Class MultipartMessage
- java.lang.Object
-
- org.apache.james.mime4j.samples.dom.MultipartMessage
-
public class MultipartMessage extends java.lang.Object
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 Constructor Description MultipartMessage()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static BinaryBody
createImageBody(StorageBodyFactory bodyFactory, java.awt.image.BufferedImage image)
Creates a binary part from the specified image.static void
main(java.lang.String[] args)
private static java.awt.image.BufferedImage
renderSampleImage()
Draws an image; unrelated to Mime4j.private static Storage
storeImage(StorageProvider storageProvider, java.awt.image.BufferedImage image, java.lang.String formatName)
Stores the specified image in a Storage object.
-
-
-
Method Detail
-
main
public static void main(java.lang.String[] args) throws java.lang.Exception
- Throws:
java.lang.Exception
-
createImageBody
private static BinaryBody createImageBody(StorageBodyFactory bodyFactory, java.awt.image.BufferedImage image) throws java.io.IOException
Creates a binary part from the specified image.- Throws:
java.io.IOException
-
storeImage
private static Storage storeImage(StorageProvider storageProvider, java.awt.image.BufferedImage image, java.lang.String formatName) throws java.io.IOException
Stores the specified image in a Storage object.- Throws:
java.io.IOException
-
renderSampleImage
private static java.awt.image.BufferedImage renderSampleImage()
Draws an image; unrelated to Mime4j.
-
-