Lookup MIME content by content-id, cid
, and return as a DataHandler
.
The returned DataHandler
instance must be configured
to meet the following required mapping constaint.
Required Mappings between MIME and Java Types
|
MIME Type |
Java Type |
DataHandler.getContentType() |
instanceof DataHandler.getContent() |
image/gif |
java.awt.Image |
image/jpeg |
java.awt.Image |
text/xml or application/xml |
javax.xml.transform.Source |
Note that it is allowable to support additional mappings.
Returns:
a {@link DataHandler} that represents the MIME attachment.
Parameters:
-
cid - It is expected to be a valid lexical form of the XML Schema
xs:anyURI
datatype. If
{@link #isXOPPackage()}
==true
, it must be a valid URI per the
cid:
URI scheme (see
RFC 2387)
Throws:
-
IllegalArgumentException - if the attachment for the given cid is not found.