magoffin.matt.ma2
Interface MediaMetadata

All Known Implementing Classes:
AbstractMediaMetadata, SmetaMediaMetadata

public interface MediaMetadata

Metadata about a media item.

This API exists to give a simple method to get meta data about a variety of media types (image, video, sound, etc) without needing to know the method the meta data was retrieved by.

Author:
Matt Magoffin (spamsqr@msqr.us)

Method Summary
 java.util.Date getCreationDate()
          Get the date the item was created.
 java.util.Map<java.lang.String,java.lang.String> getMetadataMap()
          Get a Map of all meta data values.
 MediaMetadata setMediaResource(org.springframework.core.io.Resource resource)
          Set the media resource from which to extract metadata from.
 

Method Detail

setMediaResource

MediaMetadata setMediaResource(org.springframework.core.io.Resource resource)
Set the media resource from which to extract metadata from.

After this method is called, the other methods on the returned instance should return meta data extracted from this resource. Note the returned instance may not be the same instance as the one the method is called on, so that during the extraction process a more-specific instance can be returned (e.g. for a digital camera metadata instance, a generic image metadata might be instantiated, but a more specific one returned by this method when it discovers the type of camera make/model the media resource was taken with).

Parameters:
resource - the media resource being processed
Returns:
a MediaMetadata instance, may be a new instance or the same instance this method was called on

getCreationDate

java.util.Date getCreationDate()
Get the date the item was created.

This method should return a "creation date" for the media resource, if found in the resource's metadat. For example the EXIF metadata format stores the date/time the image was created, i.e. the date/time the photo was taken. This method should return that date. If no appropriate date can be found in the media resource's metadata, this method should return null.

This method can only be called after setMediaResource(Resource) has been called on this particular MediaMetadata instance.

Returns:
Date, or null if unknown

getMetadataMap

java.util.Map<java.lang.String,java.lang.String> getMetadataMap()
Get a Map of all meta data values.

This method should return a Map of all avaialble metadata values extracted from the media resource that can be represented as simple String values. These values can then be added to a MediaItem instance's Metadata (i.e. the List returned by MediaItem.getMetadata().

This method can only be called after setMediaResource(Resource) has been called on this particular MediaMetadata instance.

Returns:
map of all available meta data extracted from the resource