Package eu.webtoolkit.jwt
Class WSelfDeletingResource
java.lang.Object
eu.webtoolkit.jwt.WObject
eu.webtoolkit.jwt.WResource
eu.webtoolkit.jwt.WMemoryResource
eu.webtoolkit.jwt.WSelfDeletingResource
A resource which removes itself after being served.
This resource will automatically unexpose itself after being served.
This resource is mainly intended to be used as output for the WResource.getBotResource() in order to free memory once the bot has fetched the resource.
This resource has auto removal allowed by default.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class eu.webtoolkit.jwt.WResource
WResource.DispositionTypeNested classes/interfaces inherited from class eu.webtoolkit.jwt.WObject
WObject.FormData -
Constructor Summary
ConstructorsConstructorDescriptionWSelfDeletingResource(String mimeType) Creates a new resource with given mime-type. -
Method Summary
Modifier and TypeMethodDescriptionvoidhandleRequest(WebRequest request, WebResponse response) Handles a request.Methods inherited from class eu.webtoolkit.jwt.WMemoryResource
getData, getMimeType, setData, setMimeTypeMethods inherited from class eu.webtoolkit.jwt.WResource
dataChanged, dataExceeded, dataReceived, generateUrl, getAlternativeBotUrl, getBotResource, getBotResourceId, getDispositionType, getInternalPath, getSuggestedFileName, getUrl, getVersion, incrementVersion, isAllowAutoRemoval, isInvalidAfterChanged, setAllowAutoRemoval, setAlternativeBotUrl, setBotResourceId, setChanged, setDispositionType, setInternalPath, setInvalidAfterChanged, setTakesUpdateLock, setUploadProgress, suggestFileName, suggestFileName, takesUpdateLock, useCustomBotResourceId, write, write, writeToMemoryMethods inherited from class eu.webtoolkit.jwt.WObject
getId, getObjectName, remove, resendFormData, setFormData, setObjectName, tr
-
Constructor Details
-
WSelfDeletingResource
Creates a new resource with given mime-type.You must call setData() before using the resource.
-
-
Method Details
-
handleRequest
Description copied from class:WResourceHandles a request.Reimplement 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.
- Overrides:
handleRequestin classWMemoryResource- Parameters:
request- The request informationresponse- The response object- Throws:
IOException
-