Package ch.astorm.jotlmsg
Class OutlookMessageAttachment
- java.lang.Object
-
- ch.astorm.jotlmsg.OutlookMessageAttachment
-
public class OutlookMessageAttachment extends java.lang.ObjectRepresents a message attachment.- Author:
- Cedric Tabin
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceOutlookMessageAttachment.InputStreamCreatorRepresents anInputStreamcreator.static classOutlookMessageAttachment.MemoryInputStreamCreatorWraps the creation of anInputStreamfrom a given sourceInputStream.
-
Constructor Summary
Constructors Constructor Description OutlookMessageAttachment(java.lang.String name, java.lang.String mimeType, OutlookMessageAttachment.InputStreamCreator creator)Creates a newOutlookMessageAttachmentwith the specified parameters.OutlookMessageAttachment(java.lang.String name, java.lang.String mimeType, java.io.InputStream input)Creates a newOutlookMessageAttachmentwith the specified parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OutlookMessageAttachment.InputStreamCreatorgetInputStreamCreator()Defines theInputStreamCreatorthat handles the attachment content.java.lang.StringgetMimeType()Defines the MIME type of the attachment.java.lang.StringgetName()Returns the name of the attachment, as seen by the user.java.io.InputStreamgetNewInputStream()Returns a newInputStreamto read the content of this attachment.voidsetInputStreamCreator(OutlookMessageAttachment.InputStreamCreator is)voidsetMimeType(java.lang.String mimeType)
-
-
-
Constructor Detail
-
OutlookMessageAttachment
public OutlookMessageAttachment(java.lang.String name, java.lang.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
public OutlookMessageAttachment(java.lang.String name, java.lang.String mimeType, java.io.InputStream input)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:
OutlookMessageAttachment.MemoryInputStreamCreator
-
-
Method Detail
-
getName
public final java.lang.String 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
public java.lang.String getMimeType()
Defines the MIME type of the attachment.
-
setMimeType
public void setMimeType(java.lang.String mimeType)
-
getInputStreamCreator
public OutlookMessageAttachment.InputStreamCreator getInputStreamCreator()
Defines theInputStreamCreatorthat handles the attachment content. This value may be null.
-
setInputStreamCreator
public void setInputStreamCreator(OutlookMessageAttachment.InputStreamCreator is)
-
getNewInputStream
public java.io.InputStream getNewInputStream() throws java.io.IOExceptionReturns a newInputStreamto read the content of this attachment.- Returns:
- A new
InputStream. - Throws:
java.io.IOException- If an I/O error occurs.- See Also:
OutlookMessageAttachment.InputStreamCreator.newInputStream(ch.astorm.jotlmsg.OutlookMessageAttachment)
-
-