|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectmagoffin.matt.ma2.web.util.WebMediaResponse
public class WebMediaResponse
Web implementation of MediaResponse.
| Constructor Summary | |
|---|---|
WebMediaResponse()
Default constructor. |
|
WebMediaResponse(javax.servlet.http.HttpServletResponse webResponse,
boolean download)
Construct from an HttpServletResponse. |
|
WebMediaResponse(javax.servlet.http.HttpServletResponse webResponse,
java.lang.String filename)
Construct from an HttpServletResponse. |
|
| Method Summary | |
|---|---|
java.io.OutputStream |
getOutputStream()
Get the output stream. |
void |
setItem(MediaItem item)
Set the media item used in the response. |
void |
setMediaLength(long length)
Set the length of the media of the response. |
void |
setMimeType(java.lang.String mime)
Set the MIME type of a response. |
void |
setModifiedDate(long date)
Set the modification date of the response. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public WebMediaResponse()
public WebMediaResponse(javax.servlet.http.HttpServletResponse webResponse,
java.lang.String filename)
HttpServletResponse.
webResponse - the HttpServletResponse to respond withfilename - a filename to set on the response via a
HTTP Content-Disposition header
public WebMediaResponse(javax.servlet.http.HttpServletResponse webResponse,
boolean download)
HttpServletResponse.
webResponse - the HttpServletResponse to respond withdownload - true if should generate a download
HTTP Content-Disposition header| Method Detail |
|---|
public void setMimeType(java.lang.String mime)
MediaResponseThe MIME type of the response might be different from the MIME type
of the MediaItem in the request. For example a request for
an MP3 resource might actually return a JPG image extracted from the
metadata of that MP3 file.
setMimeType in interface MediaResponsemime - the MIME type of the responsepublic void setMediaLength(long length)
MediaResponseThis should be the lenght, in bytes, if the data representing the result of the media request processing.
setMediaLength in interface MediaResponselength - the length of the contentpublic void setItem(MediaItem item)
MediaResponseThe MediaRequest object only contains the ID of the
MediaItem to process. This method should be called with
the actual MediaItem for that ID.
setItem in interface MediaResponseitem - the media itempublic java.io.OutputStream getOutputStream()
MediaResponseThis is the OutputStream that the result of processing the
request should be written to. During request processing, the
MediaHandler doing the processing should
write the resulting media item data to this stream.
getOutputStream in interface MediaResponsepublic void setModifiedDate(long date)
MediaResponseIf possible, this method should be called and set with the last modification date of the result of processing this media request. This is to aid client caching, for clients that request media items with a "if modified since" directive, such as HTTP clients.
setModifiedDate in interface MediaResponsedate - the modification date
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||