com.google.gdata.data.media
Class MediaMultipart

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

public class MediaMultipart
extends javax.mail.internet.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.


Constructor Summary
MediaMultipart(IEntry entry, MediaSource media)
          Constructs a new MediaMultipart instance from an Atom entry instance and a media source.
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
 javax.mail.internet.MimeBodyPart createMimeBodyPart(java.io.InputStream is)
           
 javax.mail.internet.MimeBodyPart createMimeBodyPart(javax.mail.internet.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, getBodyPart, getBodyPart, getCount, getPreamble, isComplete, removeBodyPart, removeBodyPart, setPreamble, setSubType, writeTo
 
Methods inherited from class javax.mail.Multipart
getContentType, getParent, setParent
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MediaMultipart

public MediaMultipart(java.lang.String contentType,
                      java.io.InputStream inputStream)
               throws javax.mail.MessagingException
Constructs a new MediaMultipart instance by parsing MIME content from the provided input stream.

Throws:
javax.mail.MessagingException

MediaMultipart

public MediaMultipart(IEntry entry,
                      MediaSource media)
               throws javax.mail.MessagingException
Constructs a new MediaMultipart instance from an Atom entry instance and a media source.

Throws:
javax.mail.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 javax.mail.internet.MimeBodyPart createMimeBodyPart(java.io.InputStream is)
                                                    throws javax.mail.MessagingException
Overrides:
createMimeBodyPart in class javax.mail.internet.MimeMultipart
Throws:
javax.mail.MessagingException

createMimeBodyPart

public javax.mail.internet.MimeBodyPart createMimeBodyPart(javax.mail.internet.InternetHeaders headers,
                                                           byte[] content)
                                                    throws javax.mail.MessagingException
Overrides:
createMimeBodyPart in class javax.mail.internet.MimeMultipart
Throws:
javax.mail.MessagingException

getAtomPart

public MediaBodyPart getAtomPart()
Returns the body part containing atom content.


getMediaPart

public MediaBodyPart getMediaPart()
Returns the body part containing media content.