| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectmagoffin.matt.ma2.support.MimeTypeMediaHandlerDelegate
public class MimeTypeMediaHandlerDelegate
Implementation of MediaHandlerDelegate that uses a MIME type 
 mapping to delegate to any number of different MediaHandlerDelegate
 implementations.
 
 
The configurable properties of this class are:
MediaHandlerDelegate implementations to handle requests of that
   MIME type. The handleDelegateMediaRequest(org.springframework.core.io.Resource, java.lang.String, magoffin.matt.ma2.domain.MediaItem, magoffin.matt.ma2.MediaRequest, magoffin.matt.ma2.MediaResponse) method will look
   up MIME types in this map and delegate to the matching handler.
| Constructor Summary | |
|---|---|
| MimeTypeMediaHandlerDelegate() | |
| Method Summary | |
|---|---|
|  java.lang.String | getDelegateFileExtension(org.springframework.core.io.Resource mediaResource,
                         java.lang.String mimeType,
                         MediaItem item,
                         MediaRequest request)Get the preferred file extension for this handler. | 
|  java.util.Map<java.lang.String,MediaHandlerDelegate> | getDelegateMap() | 
|  void | handleDelegateMediaRequest(org.springframework.core.io.Resource mediaResource,
                           java.lang.String mimeType,
                           MediaItem item,
                           MediaRequest request,
                           MediaResponse response)Handle a delegate media request. | 
|  void | setDelegateMap(java.util.Map<java.lang.String,MediaHandlerDelegate> delegateMap) | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Constructor Detail | 
|---|
public MimeTypeMediaHandlerDelegate()
| Method Detail | 
|---|
public void handleDelegateMediaRequest(org.springframework.core.io.Resource mediaResource,
                                       java.lang.String mimeType,
                                       MediaItem item,
                                       MediaRequest request,
                                       MediaResponse response)
MediaHandlerDelegateThe mediaResource is not the original MediaItem
 resource, rather it is the media resource extracted from
 the MediaItem, e.g. the metadata resource.
handleDelegateMediaRequest in interface MediaHandlerDelegatemediaResource - the media data to processmimeType - the MIME type of the media data in mediaResourceitem - the MediaItem being processedrequest - the requestresponse - the response
public java.lang.String getDelegateFileExtension(org.springframework.core.io.Resource mediaResource,
                                                 java.lang.String mimeType,
                                                 MediaItem item,
                                                 MediaRequest request)
MediaHandlerDelegateThe mediaResource is not the original MediaItem
 resource, rather it is the media resource extracted from
 the MediaItem, e.g. the metadata resource.
Some handlers might return a different file extension for a given request then the default file extension for their type (for example a PNG image handler that returns JPEG images when resizing the images.
getDelegateFileExtension in interface MediaHandlerDelegatemediaResource - the media data to processmimeType - the MIME type of the media data in mediaResourceitem - the MediaItem being processedrequest - the request
public java.util.Map<java.lang.String,MediaHandlerDelegate> getDelegateMap()
public void setDelegateMap(java.util.Map<java.lang.String,MediaHandlerDelegate> delegateMap)
delegateMap - the delegateMap to set| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||