Noel J. Bergman wrote:
Instead, use the PhantomReference-based code that I contributed to Jakarta
Commons.
The main reason why people (misguidedly) use deleteOnExit() is to be able to generate temporary files that you can return URLs for (e.g. you generate a .PDF report, and generate an HTTP redirect to ..../foobar.pdf). And of course, have those files be cleaned up later.
You want to wait for a little while before deleting the file (5 or 10 minutes, or some other configurable timeout), to allow the user to do things like reload the URL. Also, some browsers (Mozilla in particular) reload the URL when you Print a page.
I'm not sure a reference-based cleanup would be appropriate, unless it's possible to somehow force a reference to be kept for such a period, and then magically cleaned up.
This is why I suggested an explicit cleanup thread where you could register the files you have generated, and have it clean them up after a few minutes.
I know it's bad to start up threads like this, but in the absence of anything better (that I know of), ...
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]