# Google Data APIs Client Library (1.43.0)

## com.google.gdata.data.media
Class MediaMultipart

    java.lang.Object
      javax.mail.Multipart
          javax.mail.internet.MimeMultipart
              com.google.gdata.data.media.MediaMultipart

    public class MediaMultipart

extends MimeMultipart

The MediaMultipart class provides helper code for parsing and generating MIME multipart/related content used to transport GData media resources. These messages will always contains two parts: one with the Atom metadata about the media and the other with the actual media content in any MIME format.

Field Summary
`protected MediaBodyPart` `atomPart`
`protected MediaBodyPart` `mediaPart`

Fields inherited from class javax.mail.internet.MimeMultipart
`ds, parsed`

Fields inherited from class javax.mail.Multipart
`contentType, parent, parts`

Constructor Summary
`` `MediaMultipart(IEntry entry, MediaSource media)` Constructs a new MediaMultipart instance from an Atom entry instance and a media source.
`protected` `MediaMultipart(java.lang.String subType)` Constructor for subclasses.
`` `MediaMultipart(java.lang.String contentType, java.io.InputStream inputStream)` Constructs a new MediaMultipart instance by parsing MIME content from the provided input stream.

Method Summary
`MimeBodyPart` `createMimeBodyPart(java.io.InputStream is)`
`MimeBodyPart` `createMimeBodyPart(InternetHeaders headers, byte[] content)`
`MediaBodyPart` `getAtomPart()` Returns the body part containing atom content.
`MediaBodyPart` `getMediaPart()` Returns the body part containing media content.
`static void` `loadMimeMappings()` Loads the default set of Java activation MIME mappings required by the GData library.

Methods inherited from class javax.mail.internet.MimeMultipart
`addBodyPart, addBodyPart, createInternetHeaders, getBodyPart, getBodyPart, getCount, getPreamble, isComplete, parse, removeBodyPart, removeBodyPart, setPreamble, setSubType, updateHeaders, writeTo`

Methods inherited from class javax.mail.Multipart
`getContentType, getParent, setMultipartDataSource, setParent`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### atomPart

    protected MediaBodyPart atomPart

### mediaPart

    protected MediaBodyPart mediaPart

Constructor Detail

### MediaMultipart

    protected MediaMultipart(java.lang.String subType)

  Constructor for subclasses.

### MediaMultipart

    public MediaMultipart(java.lang.String contentType,
                          java.io.InputStream inputStream)
                   throws MessagingException

  Constructs a new MediaMultipart instance by parsing MIME content from the provided input stream.

  Throws:
    `MessagingException`

### MediaMultipart

    public MediaMultipart(IEntry entry,
                          MediaSource media)
                   throws MessagingException

  Constructs a new MediaMultipart instance from an Atom entry instance and a media source.

  Throws:
    `MessagingException`

Method Detail

### loadMimeMappings

    public static void loadMimeMappings()

  Loads the default set of Java activation MIME mappings required by the GData library. Extends the basic set configured by the JavaMail library to add mappings for Atom, RSS, and JSON application types.

### createMimeBodyPart

    public MimeBodyPart createMimeBodyPart(java.io.InputStream is)
                                    throws MessagingException

  Overrides:
    `createMimeBodyPart` in class `MimeMultipart`
  Throws:
    `MessagingException`

### createMimeBodyPart

    public MimeBodyPart createMimeBodyPart(InternetHeaders headers,
                                           byte[] content)
                                    throws MessagingException

  Overrides:
    `createMimeBodyPart` in class `MimeMultipart`
  Throws:
    `MessagingException`

### getAtomPart

    public MediaBodyPart getAtomPart()

  Returns the body part containing atom content.

### getMediaPart

    public MediaBodyPart getMediaPart()

  Returns the body part containing media content.