PayloadContainer

public class PayloadContainer

An encapsulation of the payload container in an EbxmlMessage [ebMSS 2.1.4].

A Payload Container contains an ebXML MIME header as well as application payload, as illustrated in the following diagram:

1
2
3
4
5
6
7
8
Content-ID:
Content-type: application/xml

<PurchaseOrder>
  <Product>...</Product>
  ...
</PurchaseOrder>
<!--Line 1-2: ebXML MIME headers. Line 4-7: Application payload-->

This class encapsulates the structure of payload container in an ebXML message.

Author:cyng

Fields

HREF_PREFIX

public static final String HREF_PREFIX

The prefix of “href” attribute of this PayloadContainer.

Constructors

PayloadContainer

public PayloadContainer(DataHandler dataHandler, String contentId, Reference reference)

Create a PayloadContainer from the specified DataHandler.

Methods

getContentId

public String getContentId()

Get contentId.

getContentLength

public long getContentLength()

Get the content length of this payload. Note that the content length returned will be -1 if this container is not created from AttachmentDataSource. Also, the length returned does not take Content-Transfer-Encoding into account, if any.

Returns:content length of this payload

getContentType

public String getContentType()

Get content type of this attachment.

getDataHandler

public DataHandler getDataHandler()

Get javax.activation.DataHandler of this attachment.

getHref

public String getHref()

Get “href” attribute which is equal to the prefixed contentId.

getMimeHeaders

public Map getMimeHeaders()

getReference

public Reference getReference()

Get Reference inside the Manifest associated with this PayloadContainer.

setMimeHeader

public void setMimeHeader(String name, String value)