Interface AttachmentMessage

All Superinterfaces:
org.apache.camel.Message
All Known Implementing Classes:
DefaultAttachmentMessage

public interface AttachmentMessage extends org.apache.camel.Message
Extended Message for Java Attachment Support (with javax.activation).
  • Method Details

    • getAttachment

      DataHandler getAttachment(String id)
      Returns the attachment specified by the id
      Parameters:
      id - the id under which the attachment is stored
      Returns:
      the data handler for this attachment or null
    • getAttachmentObject

      Attachment getAttachmentObject(String id)
      Returns the attachment specified by the id
      Parameters:
      id - the id under which the attachment is stored
      Returns:
      the attachment or null
    • getAttachmentNames

      Set<String> getAttachmentNames()
      Returns a set of attachment names of the message
      Returns:
      a set of attachment names
    • removeAttachment

      void removeAttachment(String id)
      Removes the attachment specified by the id
      Parameters:
      id - the id of the attachment to remove
    • addAttachment

      void addAttachment(String id, DataHandler content)
      Adds an attachment to the message using the id
      Parameters:
      id - the id to store the attachment under
      content - the data handler for the attachment
    • addAttachmentObject

      void addAttachmentObject(String id, Attachment content)
      Adds an attachment to the message using the id
      Parameters:
      id - the id to store the attachment under
      content - the attachment
    • getAttachments

      Map<String,DataHandler> getAttachments()
      Returns all attachments of the message
      Returns:
      the attachments in a map or null
    • getAttachmentObjects

      Map<String,Attachment> getAttachmentObjects()
      Returns all attachments of the message
      Returns:
      the attachments in a map or null
    • setAttachments

      void setAttachments(Map<String,DataHandler> attachments)
      Set all the attachments associated with this message
      Parameters:
      attachments - the attachments
    • setAttachmentObjects

      void setAttachmentObjects(Map<String,Attachment> attachments)
      Set all the attachments associated with this message
      Parameters:
      attachments - the attachments
    • hasAttachments

      boolean hasAttachments()
      Returns whether this message has attachments.
      Returns:
      true if this message has any attachments.