Package io.quarkus.mailer
Class Attachment
- java.lang.Object
-
- io.quarkus.mailer.Attachment
-
public class Attachment extends Object
Defines an attachment.Instances of this class are not thread-safe.
-
-
Field Summary
Fields Modifier and Type Field Description static StringDISPOSITION_ATTACHMENTDisposition for attachments.static StringDISPOSITION_INLINEDisposition for inline attachments.
-
Constructor Summary
Constructors Constructor Description Attachment(String name, byte[] data, String contentType)Creates a newAttachment.Attachment(String name, byte[] data, String contentType, String contentId)Creates a newAttachment.Attachment(String name, byte[] data, String contentType, String description, String disposition)Creates a newAttachment.Attachment(String name, File file, String contentType)Creates a newAttachment.Attachment(String name, File file, String contentType, String contentId)Creates a newAttachment.Attachment(String name, Flow.Publisher<Byte> data, String contentType)Creates a newAttachment.Attachment(String name, Flow.Publisher<Byte> data, String contentType, String contentId)Creates a newAttachment.Attachment(String name, Flow.Publisher<Byte> data, String contentType, String description, String disposition)Creates a newAttachment.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetContentId()StringgetContentType()Flow.Publisher<Byte>getData()StringgetDescription()StringgetDisposition()FilegetFile()StringgetName()booleanisInlineAttachment()AttachmentsetContentId(String contentId)AttachmentsetContentType(String contentType)AttachmentsetData(byte[] data)AttachmentsetData(Flow.Publisher<Byte> data)AttachmentsetDescription(String description)AttachmentsetDisposition(String disposition)AttachmentsetFile(File file)AttachmentsetName(String name)
-
-
-
Field Detail
-
DISPOSITION_INLINE
public static final String DISPOSITION_INLINE
Disposition for inline attachments.- See Also:
- Constant Field Values
-
DISPOSITION_ATTACHMENT
public static final String DISPOSITION_ATTACHMENT
Disposition for attachments.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Attachment
public Attachment(String name, File file, String contentType)
Creates a newAttachment. Disposition is set toattachment.- Parameters:
name- the namefile- the filecontentType- the content type
-
Attachment
public Attachment(String name, File file, String contentType, String contentId)
Creates a newAttachment. Disposition is set toinline.- Parameters:
name- the namefile- the filecontentType- the content typecontentId- the content id
-
Attachment
public Attachment(String name, byte[] data, String contentType)
Creates a newAttachment. Disposition is set toattachment.- Parameters:
name- the namedata- the datacontentType- the content type
-
Attachment
public Attachment(String name, Flow.Publisher<Byte> data, String contentType)
Creates a newAttachment. Disposition is set toattachment.- Parameters:
name- the namedata- the data as a stream ofBytecontentType- the content type
-
Attachment
public Attachment(String name, byte[] data, String contentType, String contentId)
Creates a newAttachment. Disposition is set toinline.- Parameters:
name- the namedata- the datacontentType- the content typecontentId- the content id
-
Attachment
public Attachment(String name, Flow.Publisher<Byte> data, String contentType, String contentId)
Creates a newAttachment. Disposition is set toinline.- Parameters:
name- the namedata- the data as a stream ofBytecontentType- the content typecontentId- the content id
-
Attachment
public Attachment(String name, byte[] data, String contentType, String description, String disposition)
Creates a newAttachment.- Parameters:
name- the namedata- the datacontentType- the content typedescription- the descriptiondisposition- the disposition
-
Attachment
public Attachment(String name, Flow.Publisher<Byte> data, String contentType, String description, String disposition)
Creates a newAttachment.- Parameters:
name- the namedata- the data as a stream ofBytecontentType- the content typedescription- the descriptiondisposition- the disposition
-
-
Method Detail
-
getName
public String getName()
-
setName
public Attachment setName(String name)
-
getFile
public File getFile()
-
setFile
public Attachment setFile(File file)
-
getDescription
public String getDescription()
-
setDescription
public Attachment setDescription(String description)
-
getDisposition
public String getDisposition()
-
setDisposition
public Attachment setDisposition(String disposition)
-
getData
public Flow.Publisher<Byte> getData()
-
setData
public Attachment setData(byte[] data)
-
setData
public Attachment setData(Flow.Publisher<Byte> data)
-
getContentType
public String getContentType()
-
setContentType
public Attachment setContentType(String contentType)
-
getContentId
public String getContentId()
-
setContentId
public Attachment setContentId(String contentId)
-
isInlineAttachment
public boolean isInlineAttachment()
- Returns:
trueif the disposition is set toinline.
-
-