|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object magoffin.matt.ma2.support.BasicMediaResponse
public class BasicMediaResponse
Basic implementation of MediaResponse
.
Constructor Summary | |
---|---|
BasicMediaResponse()
Default constructor. |
|
BasicMediaResponse(java.io.OutputStream outputStream)
Construct with some parameters. |
Method Summary | |
---|---|
MediaItem |
getItem()
|
long |
getLength()
|
java.lang.String |
getMime()
|
long |
getModifiedDate()
|
java.io.OutputStream |
getOutputStream()
Get the output stream. |
void |
setItem(MediaItem item)
Set the media item used in the response. |
void |
setLength(long length)
|
void |
setMediaLength(long length)
Set the length of the media of the response. |
void |
setMime(java.lang.String mime)
|
void |
setMimeType(java.lang.String mime)
Set the MIME type of a response. |
void |
setModifiedDate(long date)
Set the modification date of the response. |
void |
setOutputStream(java.io.OutputStream outputStream)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BasicMediaResponse()
public BasicMediaResponse(java.io.OutputStream outputStream)
outputStream
- the output streamMethod Detail |
---|
public void setMimeType(java.lang.String mime)
MediaResponse
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.
setMimeType
in interface MediaResponse
mime
- the MIME type of the responsepublic void setMediaLength(long length)
MediaResponse
This should be the lenght, in bytes, if the data representing the result of the media request processing.
setMediaLength
in interface MediaResponse
length
- the length of the contentpublic void setModifiedDate(long date)
MediaResponse
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.
setModifiedDate
in interface MediaResponse
date
- the modification datepublic void setItem(MediaItem item)
MediaResponse
The 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 MediaResponse
item
- the media itempublic java.io.OutputStream getOutputStream()
MediaResponse
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.
getOutputStream
in interface MediaResponse
public long getLength()
public void setLength(long length)
length
- The length to set.public java.lang.String getMime()
public void setMime(java.lang.String mime)
mime
- The mime to set.public MediaItem getItem()
public long getModifiedDate()
public void setOutputStream(java.io.OutputStream outputStream)
outputStream
- The outputStream to set.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |