Just committed the patch to a branch, you can see it here
https://github.com/xwiki/xwiki-commons/commit/32fb77049fe9d8f758e776d26bfe5…
Since it contains an API break in EnvironmentConfiguration, I wanted to run it by the list
before merging it into the master.
I'll push later on today if nobody objects.
Caleb
On 04/23/2012 09:43 AM, Caleb James DeLisle wrote:
Hi,
In order to fix XWIKI-7748 and XWIKI-7749, we need a plan for deleting temporary file.
XWikiAttachmentContent uses File.deleteOnExit(), but in Sun's implementation,
deleteOnExit()
only deletes on a *clean* exit, in a crash it can't delete the files but it
doesn't tag them
so they can be deleted in the next run either. Since temp files are usually
pseudo-randomly
named, they are impossible to find and delete later.
I propose that we create a subdirectory, `java.io.tmpdir`/xwiki/ which will be removed
on
application exit. If the jvm crashes, the files will be removed next time around. Then
alter
ApplicationContext.getTemporaryDirectory() to yield this directory.
WDYT?
Caleb
_______________________________________________
devs mailing list
devs(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/devs