magoffin.matt.ma2.audio
Class BasicAudioMediaHandler
java.lang.Object
magoffin.matt.ma2.support.AbstractMediaHandler
magoffin.matt.ma2.support.BasicIconBasedMediaHandler
magoffin.matt.ma2.audio.BasicAudioMediaHandler
- All Implemented Interfaces:
- MediaHandler
public class BasicAudioMediaHandler
- extends BasicIconBasedMediaHandler
MediaHandler
implementation for audio files.
- Version:
- $Revision: 43 $ $Date: 2007-10-21 11:10:01 +1300 (Sun, 21 Oct 2007) $
- Author:
- Matt Magoffin (spamsqr@msqr.us)
Constructor Summary |
BasicAudioMediaHandler(java.lang.String mime,
java.lang.String preferredFileExtension)
Constructor. |
Methods inherited from class magoffin.matt.ma2.support.BasicIconBasedMediaHandler |
createNewMediaItem, defaultHandleIconResponse, defaultHandleRequest, getEffect, getFallbackIconName, getFileExtension, getIconResourcePathPrefix, getImageMediaRequestDelegate, getResourceLoader, handleMediaRequest, setFallbackIconName, setIconResourcePathPrefix, setImageMediaRequestDelegate, setResourceLoader |
Methods inherited from class magoffin.matt.ma2.support.AbstractMediaHandler |
applyEffects, createMetadataList, defaultHandleRequestOriginal, getDomainObjectFactory, getMediaBiz, getMediaMetadataInstance, getMime, getNoWatermarkSizes, getPreferredFileExtension, getRequestEffects, getSmetaPropertyMap, getUserBiz, needToAlter, needToRotate, setDomainObjectFactory, setMediaBiz, setMime, setNoWatermarkSizes, setPreferredFileExtension, setSmetaPropertyMap, setUserBiz |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULT_SONG_TITLE_META_KEY
public static final java.lang.String DEFAULT_SONG_TITLE_META_KEY
- The default value for the
songTitleMetaKey
property.
- See Also:
- Constant Field Values
BasicAudioMediaHandler
public BasicAudioMediaHandler(java.lang.String mime,
java.lang.String preferredFileExtension)
- Constructor.
- Parameters:
mime
- the MIMEpreferredFileExtension
- the preferred file extension
handleMetadata
protected MediaMetadata handleMetadata(MediaRequest request,
org.springframework.core.io.Resource mediaResource,
MediaItem item)
- Description copied from class:
AbstractMediaHandler
- Extract metadata from a resource and replace item metadata with
all extracted data.
This method provides a simple way to populate the Metadata
list of a newly created MediaItem
. It will generate the list
of Metadata
and then add all of them into the List returned
by MediaItem.getMetadata()
.
This method first calls AbstractMediaHandler.getMediaMetadataInstance(MediaRequest, Resource, MediaItem)
to create a new instance of MediaMetadata
and then calls
MediaMetadata.setMediaResource(Resource)
.
If MediaMetadata.getCreationDate()
returns a non-null value
then a new Calendar
instance will be created from it and used
to set the creationDate
property of the MediaItem.
If the MediaMetadata is an instance of EmbeddedImageMetadata
then EmbeddedImageMetadata.getEmbeddedImage()
will be
called, and the width/height of the returned image will be used to
set the width/height properties of the MediaItem provided.
- Overrides:
handleMetadata
in class AbstractMediaHandler
- Parameters:
request
- the reqeust (may be null)mediaResource
- the media resource to extract the metadata fromitem
- the item to replace the extracted metadata in
- Returns:
- the resulting metadata instance
getSongTitleMetaKey
public java.lang.String getSongTitleMetaKey()
- Returns:
- the songTitleMetaKey
setSongTitleMetaKey
public void setSongTitleMetaKey(java.lang.String songTitleMetaKey)
- Parameters:
songTitleMetaKey
- the songTitleMetaKey to set