Class WSelfDeletingResource


public class WSelfDeletingResource extends WMemoryResource
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:
  • Constructor Details

    • WSelfDeletingResource

      public WSelfDeletingResource(String mimeType)
      Creates a new resource with given mime-type.

      You must call setData() before using the resource.

  • Method Details

    • handleRequest

      public void handleRequest(WebRequest request, WebResponse response) throws IOException
      Description copied from class: WResource
      Handles 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:
      handleRequest in class WMemoryResource
      Parameters:
      request - The request information
      response - The response object
      Throws:
      IOException