|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface MediaResponse
API to allow setting response values during a media request and returning the result of request processing.
This API represents a response to a specific media item. In some ways it is
similar to the java ServletResponse
API. When a user
wants to view a particular media item, the application will create an instance
of this class and populate the OutputStream
instance on that
class so that getOutputStream()
returns the stream to which the
result of the request procesing should be written to.
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. |
Method Detail |
---|
void setMimeType(java.lang.String mime)
The 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.
mime
- the MIME type of the responsevoid setMediaLength(long length)
This should be the lenght, in bytes, if the data representing the result of the media request processing.
length
- the length of the contentvoid setModifiedDate(long date)
If 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.
date
- the modification datevoid setItem(MediaItem item)
The MediaRequest
object only contains the ID of the
MediaItem
to process. This method should be called with
the actual MediaItem
for that ID.
item
- the media itemjava.io.OutputStream getOutputStream()
This 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.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |