|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectau.com.whitesquare.waf.command.Response
au.com.whitesquare.waf.command.response.FileServingResponse
Last Modified $Date: 2005/09/12 12:08:45 $
| Field Summary |
| Fields inherited from class au.com.whitesquare.waf.command.Response |
servletContext |
| Constructor Summary | |
FileServingResponse()
|
|
| Method Summary | |
void |
close()
This method closes up any open resources required to process the content to be returned to the user. |
byte[] |
getChunk()
Retreives the actual content from the data source. |
String |
getClientFileName()
Retreives the file name that the client will save this file as. |
String |
getContentType()
Retreives the content type that the response will be configured with. |
String |
getFileName()
Returns the name of the file on disk that will be served to the client. |
boolean |
hasMore()
Returns if there is any more content available to be sent on the stream. |
void |
open()
This method is called to open the input stream and prepare the response to serve the content out the stream. |
void |
sendResponse(HttpServletRequest req,
HttpServletResponse resp)
|
void |
setClientFileName(String clientFileName)
Configures the name the client will treat this file as. |
void |
setContentType(String contentType)
Configures the Content Type of the response in relation to the data being returned. |
void |
setFileName(String fileName)
This is the absolute file name on disk to be retreived. |
| Methods inherited from class au.com.whitesquare.waf.command.Response |
init |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public FileServingResponse()
| Method Detail |
public void open()
throws FileNotFoundException
FileNotFoundException - if the filename cannot
be found on the file system.
public void close()
throws IOException
IOException - if closing the stream fails.public boolean hasMore()
getChunk() to retreive the next chunk
of data to be returned. The getChunk() method
will update the
status of more and then this method can be called again to see
if there is still more information.getChunk() call outside and another inside
the while loop.
getChunk()
public byte[] getChunk()
throws IOException
hasMore()
to be false.
IOException - if any inputstream reading fails.public String getFileName()
public void setFileName(String fileName)
fileName - The fileName to set.public String getContentType()
public void setContentType(String contentType)
contentType - The contentType to set.public String getClientFileName()
public void setClientFileName(String clientFileName)
clientFileName - The clientFileName to set.
public void sendResponse(HttpServletRequest req,
HttpServletResponse resp)
throws Exception
sendResponse in class Responsereq - resp -
Exception
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||