title: Execute after sending http response Java
body: <p>I want to know if this can be done.</p>
  
  <p>I got a RESTful service sending a <code>javax.ws.rs.core.Response</code> response like this </p>
  
  <pre><code>File filer =  new File("C:\tempfile.txt");
  
  return Response.ok(filer, MediaType.APPLICATION_OCTET_STREAM).header("content-disposition", "attachment; filename=\"" + newName + "\"").build();
  </code></pre>
  
  <p>I want to delete file after http response has been sent to the client (making filer a temporary file on server). </p>
  
  <p>I thank your help in advance.</p>