Package ch.astorm.jotlmsg
Class OutlookMessageAttachment
- java.lang.Object
-
- ch.astorm.jotlmsg.OutlookMessageAttachment
-
public class OutlookMessageAttachment extends Object
Represents 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(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OutlookMessageAttachment.InputStreamCreatorgetInputStreamCreator()Defines theInputStreamCreatorthat handles the attachment content.StringgetMimeType()Defines the MIME type of the attachment.StringgetName()Returns the name of the attachment, as seen by the user.InputStreamgetNewInputStream()Returns a newInputStreamto read the content of this attachment.voidsetInputStreamCreator(OutlookMessageAttachment.InputStreamCreator is)voidsetMimeType(String mimeType)
-
-
-
Constructor Detail
-
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
public OutlookMessageAttachment(String name, String mimeType, 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 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 String getMimeType()
Defines the MIME type of the attachment.
-
setMimeType
public void setMimeType(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 InputStream getNewInputStream() throws IOException
Returns a newInputStreamto read the content of this attachment.- Returns:
- A new
InputStream. - Throws:
IOException- If an I/O error occurs.- See Also:
OutlookMessageAttachment.InputStreamCreator.newInputStream(ch.astorm.jotlmsg.OutlookMessageAttachment)
-
-