public class Attachment extends Object
Instances of this class are not thread-safe.
Modifier and Type | Field and Description |
---|---|
static String |
DISPOSITION_ATTACHMENT
Disposition for attachments.
|
static String |
DISPOSITION_INLINE
Disposition for inline attachments.
|
Constructor and Description |
---|
Attachment(String name,
byte[] data,
String contentType)
Creates a new
Attachment . |
Attachment(String name,
byte[] data,
String contentType,
String contentId)
Creates a new
Attachment . |
Attachment(String name,
byte[] data,
String contentType,
String description,
String disposition)
Creates a new
Attachment . |
Attachment(String name,
File file,
String contentType)
Creates a new
Attachment . |
Attachment(String name,
File file,
String contentType,
String contentId)
Creates a new
Attachment . |
Attachment(String name,
org.reactivestreams.Publisher<Byte> data,
String contentType)
Creates a new
Attachment . |
Attachment(String name,
org.reactivestreams.Publisher<Byte> data,
String contentType,
String contentId)
Creates a new
Attachment . |
Attachment(String name,
org.reactivestreams.Publisher<Byte> data,
String contentType,
String description,
String disposition)
Creates a new
Attachment . |
Modifier and Type | Method and Description |
---|---|
String |
getContentId() |
String |
getContentType() |
org.reactivestreams.Publisher<Byte> |
getData() |
String |
getDescription() |
String |
getDisposition() |
File |
getFile() |
String |
getName() |
boolean |
isInlineAttachment() |
Attachment |
setContentId(String contentId) |
Attachment |
setContentType(String contentType) |
Attachment |
setData(byte[] data) |
Attachment |
setData(org.reactivestreams.Publisher<Byte> data) |
Attachment |
setDescription(String description) |
Attachment |
setDisposition(String disposition) |
Attachment |
setFile(File file) |
Attachment |
setName(String name) |
public static final String DISPOSITION_INLINE
public static final String DISPOSITION_ATTACHMENT
public Attachment(String name, File file, String contentType)
Attachment
. Disposition is set to attachment
.name
- the namefile
- the filecontentType
- the content typepublic Attachment(String name, File file, String contentType, String contentId)
Attachment
. Disposition is set to inline
.name
- the namefile
- the filecontentType
- the content typecontentId
- the content idpublic Attachment(String name, byte[] data, String contentType)
Attachment
. Disposition is set to attachment
.name
- the namedata
- the datacontentType
- the content typepublic Attachment(String name, org.reactivestreams.Publisher<Byte> data, String contentType)
Attachment
. Disposition is set to attachment
.name
- the namedata
- the data as a stream of Byte
contentType
- the content typepublic Attachment(String name, byte[] data, String contentType, String contentId)
Attachment
. Disposition is set to inline
.name
- the namedata
- the datacontentType
- the content typecontentId
- the content idpublic Attachment(String name, org.reactivestreams.Publisher<Byte> data, String contentType, String contentId)
Attachment
. Disposition is set to inline
.name
- the namedata
- the data as a stream of Byte
contentType
- the content typecontentId
- the content idpublic Attachment(String name, byte[] data, String contentType, String description, String disposition)
Attachment
.name
- the namedata
- the datacontentType
- the content typedescription
- the descriptiondisposition
- the dispositionpublic Attachment(String name, org.reactivestreams.Publisher<Byte> data, String contentType, String description, String disposition)
Attachment
.name
- the namedata
- the data as a stream of Byte
contentType
- the content typedescription
- the descriptiondisposition
- the dispositionpublic String getName()
public Attachment setName(String name)
public File getFile()
public Attachment setFile(File file)
public String getDescription()
public Attachment setDescription(String description)
public String getDisposition()
public Attachment setDisposition(String disposition)
public org.reactivestreams.Publisher<Byte> getData()
public Attachment setData(byte[] data)
public Attachment setData(org.reactivestreams.Publisher<Byte> data)
public String getContentType()
public Attachment setContentType(String contentType)
public String getContentId()
public Attachment setContentId(String contentId)
public boolean isInlineAttachment()
true
if the disposition is set to inline
.Copyright © 2019 JBoss by Red Hat. All rights reserved.