UnsupportedDataTypeException when invoking getContent() on a bodypart

  • Share
  • Share

Applies to:
NA

Description:
Occurs when invoking getContent() method on a bodypart.

Cause:
You have tried to invoke getContent() method on a bodypart.

JAVA-Mail ,

  1. admin
    March 20th, 2009 at 10:28 | #1

    The getContent() method returns a Java object that represents the bodypart content. For this to work, a JAF DataContentHandler corresponding to the content’s MIME type must be registered. Otherwise, the UnsupportedDataTypeException will be thrown. In this case, you can use the getInputStream() method to retrieve the content as a stream of bytes. See the JAF docs for details on how to create and register your own DataContentHandlers.

  1. No trackbacks yet.