Package ch.astorm.jotlmsg
Class OutlookMessageAttachment
java.lang.Object
ch.astorm.jotlmsg.OutlookMessageAttachment
Represents a message attachment.
- Author:
- Cedric Tabin
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceRepresents anInputStreamcreator.static classWraps the creation of anInputStreamfrom a given sourceInputStream. -
Constructor Summary
ConstructorsConstructorDescriptionOutlookMessageAttachment(String name, String mimeType, OutlookMessageAttachment.InputStreamCreator creator) Creates a newOutlookMessageAttachmentwith the specified parameters.OutlookMessageAttachment(String name, String mimeType, InputStream input) Creates a newOutlookMessageAttachmentwith the specified parameters. -
Method Summary
Modifier and TypeMethodDescriptionDefines theInputStreamCreatorthat handles the attachment content.Defines the MIME type of the attachment.final StringgetName()Returns the name of the attachment, as seen by the user.Returns a newInputStreamto read the content of this attachment.voidvoidsetMimeType(String mimeType)
-
Constructor Details
-
OutlookMessageAttachment
public OutlookMessageAttachment(String name, String mimeType, OutlookMessageAttachment.InputStreamCreator creator) Creates a newOutlookMessageAttachmentwith the specified parameters.- Parameters:
name- The attachment's name.mimeType- The MIME type of the attachment.creator- TheInputStreamCreatoror null.
-
OutlookMessageAttachment
Creates a newOutlookMessageAttachmentwith the specified parameters. A newMemoryInputStreamCreatorwill be created with the specifiedinputas source.- Parameters:
name- The attachment's name.mimeType- The MIME type of the attachment.input- The input or null.- See Also:
-
-
Method Details
-
getName
Returns the name of the attachment, as seen by the user. This value cannot be null nor empty.- Returns:
- The name of the attachment.
-
getMimeType
Defines the MIME type of the attachment. -
setMimeType
-
getInputStreamCreator
Defines theInputStreamCreatorthat handles the attachment content. This value may be null. -
setInputStreamCreator
-
getNewInputStream
Returns a newInputStreamto read the content of this attachment.- Returns:
- A new
InputStream. - Throws:
IOException- If an I/O error occurs.- See Also:
-