Package org.apache.camel.attachment
Interface Attachment
- All Known Implementing Classes:
DefaultAttachment
public interface Attachment
Represents an attachment as part of a
Message
.-
Method Summary
Modifier and TypeMethodDescriptionvoid
Add this value to the existing values for this headerName.jakarta.activation.DataHandler
Return a DataHandler for the content within this attachment.Get all the headers for this header name.getHeaderAsList
(String name) Get all the headers for this header name.Get all header names for this attachment.void
removeHeader
(String headerName) Remove all headers with this name.void
Set the value for this headerName.
-
Method Details
-
getDataHandler
jakarta.activation.DataHandler getDataHandler()Return a DataHandler for the content within this attachment.- Returns:
- DataHandler for the content
-
getHeader
Get all the headers for this header name. Returns null if no headers for this header name are available.- Parameters:
headerName
- he name of this header- Returns:
- a comma separated list of all header values
-
getHeaderAsList
Get all the headers for this header name. Returns null if no headers for this header name are available.- Parameters:
name
- The name of this header- Returns:
- a list of all header values
-
getHeaderNames
Collection<String> getHeaderNames()Get all header names for this attachment.- Returns:
- a collection of all header names
-
setHeader
Set the value for this headerName. Replaces all existing header values with this new value.- Parameters:
headerName
- the name of this headerheaderValue
- the value for this header
-
addHeader
Add this value to the existing values for this headerName.- Parameters:
headerName
- the name of this headerheaderValue
- the value for this header
-
removeHeader
Remove all headers with this name.- Parameters:
headerName
- the name of this header
-