public class Attachment extends Object implements XAttachment
XAttachment| Constructor and Description |
|---|
Attachment(XAttachment xAttachment) |
Attachment(XMessageFormat payload) |
Attachment(XMessageFormat payload,
String contentType) |
Attachment(XMessageFormat payload,
String contentType,
MultiValueMap<String,String> headers) |
| Modifier and Type | Method and Description |
|---|---|
void |
addTransportHeader(String key,
String value)
Add a transport header to this attachment
|
XAttachment |
copyOf()
Creates a copy of this attachment including the payload
|
Optional<String> |
getContentType()
Retrieves the contentType of the attachment
|
Map<String,List<String>> |
getDuplicateStringTransportHeaders()
Get the map of current transport header duplicate values
|
Optional<String> |
getFirstStringTransportHeader(String key)
Get the first transport header with the given key wrapped in an
Optional |
Optional<String> |
getFirstStringTransportHeaderIgnoreCase(String key)
Get the first transport header with the given key ignoring case wrapped in an
Optional |
XMessageFormat |
getPayload()
Get the payload of the attachment
|
Map<String,String> |
getStringTransportHeaders()
Get the map of current transport header values ignoring duplicates
|
List<String> |
getStringTransportHeaders(String key)
Get a List of transport header values for the given key
|
void |
removeAllTransportHeaders()
Remove all transport headers
|
void |
removeTransportHeader(String key)
Remove all occurrences of the specified transport header
|
void |
removeTransportHeaders(String... headers)
Remove transport headers specified in the comma separated list
|
void |
replaceTransportHeader(String key,
String value)
Replace the first occurrence of the transport header with the given value
|
void |
retainOnlyTransportHeaders(String... headers)
Retain only transport headers specified in the comma separated list
|
void |
setContentType(String contentType)
Set the content type of the attachment
|
void |
setPayload(XMessageFormat payload)
Set payload of the attachment
|
public Attachment(XAttachment xAttachment)
public Attachment(XMessageFormat payload)
public Attachment(XMessageFormat payload, String contentType)
public Attachment(XMessageFormat payload, String contentType, MultiValueMap<String,String> headers)
public Optional<String> getContentType()
XAttachmentgetContentType in interface XAttachmentOptional containing the content-type string value if it exists
and Optional.EMPTY otherwisepublic void setContentType(String contentType)
XAttachmentsetContentType in interface XAttachmentcontentType - the content type string to be setpublic XMessageFormat getPayload()
XAttachmentgetPayload in interface XAttachmentXMessageFormat value which represents the attachment payloadpublic void setPayload(XMessageFormat payload)
XAttachmentsetPayload in interface XAttachmentpayload - XMessageFormat value which represents payloadpublic void addTransportHeader(String key, String value)
XAttachmentaddTransportHeader in interface XAttachmentkey - header namevalue - header valuepublic Optional<String> getFirstStringTransportHeader(String key)
XAttachmentOptionalgetFirstStringTransportHeader in interface XAttachmentkey - String key representing header field keyOptional containing header content if it exists and Optional.EMPTY otherwisepublic Optional<String> getFirstStringTransportHeaderIgnoreCase(String key)
XAttachmentOptionalgetFirstStringTransportHeaderIgnoreCase in interface XAttachmentkey - String key representing header field keyOptional containing header content if it exists and Optional.EMPTY otherwisepublic List<String> getStringTransportHeaders(String key)
XAttachmentgetStringTransportHeaders in interface XAttachmentkey - the name of the transport header that is to be retrievedpublic Map<String,String> getStringTransportHeaders()
XAttachmentgetStringTransportHeaders in interface XAttachmentpublic Map<String,List<String>> getDuplicateStringTransportHeaders()
XAttachmentgetDuplicateStringTransportHeaders in interface XAttachmentpublic void removeTransportHeader(String key)
XAttachmentremoveTransportHeader in interface XAttachmentkey - header name to removepublic void removeAllTransportHeaders()
XAttachmentremoveAllTransportHeaders in interface XAttachmentpublic void removeTransportHeaders(String... headers)
XAttachmentremoveTransportHeaders in interface XAttachmentheaders - a list of transport headers to removepublic void retainOnlyTransportHeaders(String... headers)
XAttachmentretainOnlyTransportHeaders in interface XAttachmentheaders - a list of transport headers to retainpublic void replaceTransportHeader(String key, String value)
XAttachmentreplaceTransportHeader in interface XAttachmentkey - the header namevalue - the new valuepublic XAttachment copyOf()
XAttachmentcopyOf in interface XAttachmentXAttachmentCopyright © 2016–2019 AdroitLogic. All rights reserved.