Resources and files on disk

Hi,

In my application I am receiving almost all the info through a web service. I get file attachments also via webservice.
In order to provide a download link I do the following:

for (AttachmentReference attachment : attachments)
{
   Button attachmentButton = new Button(attachment.getFilename());
   attachmentButton.addStyleName("link-button");
   attachmentButton.setIcon(new ThemeResource(ICON_SMALL));
   final String domIdNo = "" + attachment.getDomIdno();
         
   Resource res = new FileResource(getFile(btrRfid, "" + domIdNo));
   FileDownloader fd = new FileDownloader(res);
   fd.extend(attachmentButton);
           
   attachmentLayout.addComponent(attachmentButton);
}

When I create the resource, a file is created in the workspace and it’s never deleted.
Is it possible to have the file in memory only? If not, how can I remove the files once they are not needed then?

What about extending
FileDownloader:

    @Override
    public boolean handleConnectorRequest(VaadinRequest request,
            VaadinResponse response, String path) throws IOException {
     boolean result = super.handleConnectorRequest(request, response, path);
     if (result) {
        new File(path).delete();
     }
     return result;
    }