Oracle Fusion Middleware Communication Services 11.1.1.3.0 Java API Reference
E14785-02

oracle.sdp.parlayx.multimedia_messaging
Class ContentUtil

java.lang.Object
  extended by oracle.sdp.parlayx.multimedia_messaging.ContentUtil

public class ContentUtil
extends java.lang.Object

Since:
release specific (what release of product did this appear in)

Field Summary
static ContentType ANY_MULTIPART_TYPE
          ContentType object representing the "multipart/*" MIME type.
static ContentType ANY_TEXT_TYPE
          ContentType object representing the "text/*" MIME type.
 
Constructor Summary
ContentUtil()
           
 
Method Summary
static byte[] getBytes(BodyPart p)
          Get binary (byte array) content from the provided BodyPart.
static byte[] getBytes(javax.activation.DataHandler dh)
          Get binary (byte array) content from the provided DataHandler.
static java.lang.Object getContent(BodyPart p)
          Get content object from a BodyPart.
static java.lang.Object getContent(javax.activation.DataHandler dh, java.lang.String contentType)
          Get content object from a DataHandler.
static java.lang.String getString(BodyPart p)
          Get String content from the provided BodyPart.
static java.lang.String getString(javax.activation.DataHandler dh)
          Get String content from the provided DataHandler.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ANY_MULTIPART_TYPE

public static ContentType ANY_MULTIPART_TYPE
ContentType object representing the "multipart/*" MIME type.


ANY_TEXT_TYPE

public static ContentType ANY_TEXT_TYPE
ContentType object representing the "text/*" MIME type.

Constructor Detail

ContentUtil

public ContentUtil()
Method Detail

getBytes

public static byte[] getBytes(BodyPart p)
                       throws MessagingException,
                              IOException
Get binary (byte array) content from the provided BodyPart. Unwraps any DataHandler/DataSource to get the underlying byte data.

Parameters:
p -
Returns:
Throws:
MessagingException
IOException

getBytes

public static byte[] getBytes(javax.activation.DataHandler dh)
                       throws MessagingException,
                              IOException
Get binary (byte array) content from the provided DataHandler. Unwraps any DataSource to get the underlying byte data.

Parameters:
dh -
Returns:
Throws:
MessagingException
IOException

getContent

public static java.lang.Object getContent(BodyPart p)
                                   throws MessagingException,
                                          IOException
Get content object from a BodyPart. If this is a BodyPart for which String or byte[] content has been wrapped in a DataHandler/DataSource, unwrap the original object and return it. If this part contains a Multipart object, return that. Otherwise defer to the JavaMail getContent implementation, which depends on a correctly configured CommandMap and is therefore not reliable in all environments.

Parameters:
p -
Returns:
Throws:
MessagingException
IOException

getContent

public static java.lang.Object getContent(javax.activation.DataHandler dh,
                                          java.lang.String contentType)
                                   throws MessagingException,
                                          IOException
Get content object from a DataHandler. If this is a BodyPart for which String or byte[] content has been wrapped in a DataSource, unwrap the original object and return it. If this part contains a Multipart object, return that. Otherwise defer to the JavaMail getContent implementation, which depends on a correctly configured CommandMap and is therefore not reliable in all environments.

Parameters:
p -
Returns:
Throws:
MessagingException
IOException

getString

public static java.lang.String getString(BodyPart p)
                                  throws MessagingException,
                                         IOException
Get String content from the provided BodyPart. Unwraps any DataHandler/DataSource to get the underlying String data.

Parameters:
p -
Returns:
Throws:
MessagingException
IOException

getString

public static java.lang.String getString(javax.activation.DataHandler dh)
                                  throws MessagingException,
                                         IOException
Get String content from the provided DataHandler. Unwraps any DataSource to get the underlying String data.

Parameters:
dh -
Returns:
Throws:
MessagingException
IOException

Oracle Fusion Middleware Communication Services 11.1.1.3.0 Java API Reference
E14785-02

Copyright © 2005, 2010 Oracle and/or its affiliates. All rights reserved.