com.google.gdata.data.media
Class MediaEntry<E extends BaseEntry<E>>

java.lang.Object
  extended by com.google.gdata.data.AbstractExtension
      extended by com.google.gdata.data.ExtensionPoint
          extended by com.google.gdata.data.BaseEntry<E>
              extended by com.google.gdata.data.media.MediaEntry<E>
Type Parameters:
E - the entry class for the bound subtype.
All Implemented Interfaces:
Extension, IAtom, IEntry, Kind.Adaptable, Kind.Adaptor, IMediaEntry
Direct Known Subclasses:
BaseContentEntry, CaptionTrackEntry, DocumentEntry, DocumentListEntry, GlossaryEntry, GoogleBaseMediaEntry, GphotoEntry, MailItemEntry, MapEntry, TranslationMemoryEntry, VideoEntry

public abstract class MediaEntry<E extends BaseEntry<E>>
extends BaseEntry<E>
implements IMediaEntry

The MediaEntry class is an abstract base class for GData services that support media content.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.google.gdata.data.BaseEntry
BaseEntry.AtomHandler
 
Nested classes/interfaces inherited from class com.google.gdata.data.ExtensionPoint
ExtensionPoint.CumulativeBlobHandler, ExtensionPoint.ExtensionHandler
 
Method Summary
 Link getMediaEditLink()
          Retrieves the media resource edit link.
 MediaSource getMediaSource()
          Returns the MediaSource that contains the media data for the entry.
 void setMediaSource(MediaSource mediaSource)
          Sets the MediaSource that contains the media data for the entry.
 void setService(Service v)
          Sets the service that this resource is being used with.
 E updateMedia(boolean updateEntry)
          Updates the media content associated with this entry by sending the data contained in the MediaSource of the entry to the associated GData service.
 
Methods inherited from class com.google.gdata.data.BaseEntry
addAdaptor, addHtmlLink, addLink, addLink, delete, generate, generateAtom, generateRss, getAdaptedEntry, getAdaptor, getAdaptors, getAuthors, getCanEdit, getCategories, getContent, getContributors, getEdited, getEditLink, getEtag, getHandler, getHtmlLink, getId, getKind, getLink, getLinks, getLinks, getPlainTextContent, getPubControl, getPublished, getResumableEditMediaLink, getRights, getSelectedFields, getSelf, getSelfLink, getService, getSource, getSummary, getTextContent, getTitle, getUpdated, getVersionId, isDraft, parseAtom, parseAtom, parseAtom, readEntry, readEntry, removeLinks, removeLinks, setCanEdit, setContent, setContent, setDraft, setEdited, setEtag, setId, setKind, setPubControl, setPublished, setRights, setSelectedFields, setSource, setSummary, setTitle, setUpdated, setVersionId, update
 
Methods inherited from class com.google.gdata.data.ExtensionPoint
addExtension, addRepeatingExtension, declareExtensions, generateCumulativeXmlBlob, getExtension, getExtensions, getRepeatingExtension, getRepeatingExtensions, getXmlBlob, hasExtension, hasRepeatingExtension, parseCumulativeXmlBlob, removeExtension, removeExtension, removeRepeatingExtension, setExtension, setXmlBlob, visit
 
Methods inherited from class com.google.gdata.data.AbstractExtension
disableStrictValidation, enableStrictValidation, getExtensionLocalName, getExtensionNamespace, isImmutable, isStrictValidation, setImmutable
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.google.gdata.data.IEntry
getCanEdit, getContent, getEdited, getEditLink, getPublished, getResumableEditMediaLink, getSelectedFields, getSummary, setCanEdit, setEdited, setPublished, setSelectedFields
 
Methods inherited from interface com.google.gdata.data.IAtom
addLink, getAuthors, getCategories, getEtag, getId, getKind, getLink, getLinks, getSelfLink, getTitle, getUpdated, getVersionId, removeLinks, removeLinks, setEtag, setId, setKind, setUpdated, setVersionId
 
Methods inherited from interface com.google.gdata.data.Kind.Adaptor
declareExtensions
 

Method Detail

setService

public void setService(Service v)
Description copied from interface: IAtom
Sets the service that this resource is being used with.

Specified by:
setService in interface IAtom
Overrides:
setService in class BaseEntry<E extends BaseEntry<E>>

setMediaSource

public void setMediaSource(MediaSource mediaSource)
Description copied from interface: IMediaEntry
Sets the MediaSource that contains the media data for the entry.

Specified by:
setMediaSource in interface IMediaEntry

getMediaSource

public MediaSource getMediaSource()
Description copied from interface: IMediaEntry
Returns the MediaSource that contains the media data for the entry.

Specified by:
getMediaSource in interface IMediaEntry

getMediaEditLink

public Link getMediaEditLink()
Retrieves the media resource edit link.

Specified by:
getMediaEditLink in interface IEntry
Overrides:
getMediaEditLink in class BaseEntry<E extends BaseEntry<E>>

updateMedia

public E updateMedia(boolean updateEntry)
                                   throws java.io.IOException,
                                          ServiceException
Updates the media content associated with this entry by sending the data contained in the MediaSource of the entry to the associated GData service. Can optionally update the entry content at the same time.

Parameters:
updateEntry - set to {code boolean} true if the current entry content should be updated with the media.
Returns:
the updated entry returned by the Service.
Throws:
ServiceException - If there is no associated GData service or the service is unable to perform the update.
InvalidEntryException - If the entry does not contain MediaContent or there is no MediaSource associated with the content.
java.lang.UnsupportedOperationException - If update is not supported for the target entry.
java.io.IOException - If there is an error communicating with the GData service.