|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecteu.webtoolkit.jwt.WObject
eu.webtoolkit.jwt.WResource
eu.webtoolkit.jwt.WFileResource
public class WFileResource
A resource which streams data from a local file.
To update the resource, either use setFileName() to point it to a
new file, or trigger the WResource.dataChanged() signal when only the
file contents has changed, but not the filename.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class eu.webtoolkit.jwt.WResource |
|---|
WResource.DispositionType |
| Constructor Summary | |
|---|---|
WFileResource(java.lang.String mimeType,
java.lang.String fileName)
Creates a new resource with given mime-type for a file. |
|
WFileResource(java.lang.String mimeType,
java.lang.String fileName,
WObject parent)
Creates a new resource with given mime-type for a file. |
|
| Method Summary | |
|---|---|
java.lang.String |
getFileName()
Returns the file name. |
java.lang.String |
getMimeType()
Returns the mime type. |
void |
handleRequest(WebRequest request,
WebResponse response)
Handles a request. |
void |
setFileName(java.lang.String fileName)
Changes the file name. |
void |
setMimeType(java.lang.String mimeType)
Changes the mime type. |
| Methods inherited from class eu.webtoolkit.jwt.WResource |
|---|
dataChanged, dataReceived, generateUrl, getDispositionType, getInternalPath, getSuggestedFileName, getUrl, setChanged, setDispositionType, setInternalPath, setUploadProgress, suggestFileName, suggestFileName, write, write |
| Methods inherited from class eu.webtoolkit.jwt.WObject |
|---|
addChild, getId, getObjectName, remove, setObjectName, tr |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public WFileResource(java.lang.String mimeType,
java.lang.String fileName,
WObject parent)
mimeType - the mime type of the file.fileName - the file name.parent - the resources' parent
public WFileResource(java.lang.String mimeType,
java.lang.String fileName)
mimeType - the mime type of the file.fileName - the file name.| Method Detail |
|---|
public void setFileName(java.lang.String fileName)
This causes the resource to be refreshed in the browser by triggering WResource.dataChanged().
fileName - the new filename.public java.lang.String getFileName()
public java.lang.String getMimeType()
public void setMimeType(java.lang.String mimeType)
This causes the resource to be refreshed in the browser by triggering WResource.dataChanged().
mimeType -
public void handleRequest(WebRequest request,
WebResponse response)
WResourceReimplement this method so that a proper response is generated for the given request. From the request object you can access request parameters and whether the request is a continuation request. In the response object, you should set the mime type and stream the output data.
handleRequest in class WResourcerequest - The request informationresponse - The response object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||