public interface MailAttachment
Modifier and Type | Method and Description |
---|---|
MailAttachment |
addHeader(String key,
String value)
Add an header to this attachment.
|
static MailAttachment |
create()
construct an empty MailAttachment object that can be filled with the
setters
|
static MailAttachment |
create(JsonObject json)
create a MailAttachment object from a JsonObject representation
|
static MailAttachment |
create(MailAttachment other)
create a copy of a MailAttachment object
|
String |
getContentId()
get the Content-ID field
|
String |
getContentType()
get the Content-Type
|
Buffer |
getData()
get the data
|
String |
getDescription()
get the description field
|
String |
getDisposition()
get the disposition field
|
MultiMap |
getHeaders()
Get the headers to be added for this attachment.
|
String |
getName()
get the name
|
int |
getSize()
Gets the size of the attachment.
|
ReadStream<Buffer> |
getStream()
Gets the data stream.
|
MailAttachment |
setContentId(String contentId)
set the Content-ID field to be used in the attachment
|
MailAttachment |
setContentType(String contentType)
set the Content-Type
|
MailAttachment |
setData(Buffer data)
set the data
|
MailAttachment |
setDescription(String description)
set the description field to be used in the attachment
|
MailAttachment |
setDisposition(String disposition)
set the disposition field to be used in the attachment
|
MailAttachment |
setHeaders(MultiMap headers)
Set the headers to be added for this attachment.
|
MailAttachment |
setName(String name)
set the name
|
MailAttachment |
setSize(int size)
Sets the size of the attachment.
|
MailAttachment |
setStream(ReadStream<Buffer> stream)
Sets the data stream.
|
JsonObject |
toJson()
convert this object to JSON representation
|
static MailAttachment create()
static MailAttachment create(JsonObject json)
json
- object to be copiedstatic MailAttachment create(MailAttachment other)
other
- object to be copiedBuffer getData()
MailAttachment setData(Buffer data)
data
- Buffer of bytes to be used at attachmentReadStream<Buffer> getStream()
MailAttachment setStream(ReadStream<Buffer> stream)
stream
- data stream to be used at attachmentint getSize()
MailAttachment setSize(int size)
It is needed when using ReadStream for the MailAttachement.
size
- the size of the attachmentString getName()
MailAttachment setName(String name)
name
- name of the attachment filename is the descriptive filename that will be put into the mail i.e. usually a local filename without path this can be set to "" to omit the filename attribute
String getContentType()
MailAttachment setContentType(String contentType)
contentType
- the contentTypeString getDisposition()
MailAttachment setDisposition(String disposition)
disposition
- the dispositionString getDescription()
MailAttachment setDescription(String description)
description
- the descriptionString getContentId()
MailAttachment setContentId(String contentId)
contentId
- the content idMailAttachment addHeader(String key, String value)
key
- the header keyvalue
- the header valueMultiMap getHeaders()
MailAttachment setHeaders(MultiMap headers)
headers
- the headers to be addedJsonObject toJson()
Copyright © 2024 Eclipse. All rights reserved.