Summary: | [PATCH] SXSSF temporary files not deleted on Windows | ||
---|---|---|---|
Product: | POI | Reporter: | Stefan Helfert <stefan.helfert> |
Component: | SXSSF | Assignee: | POI Developers List <dev> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | benjamin.bentmann |
Priority: | P2 | ||
Version: | 3.8-dev | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Attachments: |
Patch File created with ANT patch.xml
TextfileOutput patchfile for fixing temporaryFile error patch for issue Program to reproduce the issue |
Created attachment 27824 [details]
TextfileOutput
Created attachment 27826 [details]
patchfile for fixing temporaryFile error
Created attachment 27828 [details]
patch for issue
Alternative patch that closes resources in finally blocks to ensure files get closed in case of errors as well.
Created attachment 27894 [details]
Program to reproduce the issue
To find the temporary directory on Windows type %TEMP% into the "Search programs and files" edit at the bottom of the start menu. On my machine it is "C:\Users\Alex\AppData\Local\Temp".
Benjamin's patch looks good to me. I tested it on Windows with the small program supplied by Stefan (See attachment 27894 [details]). The temp files are removed on both normal and abnormal termination (Hit ^c when the program prompts for input).
|
Created attachment 27823 [details] Patch File created with ANT patch.xml The SXSSF API is creating two temporary files during the build process: poi-sxxsf-sheet.xml poi-sxxsf-template.xlsx These two files wont by deleted after the vm got shutted down. (Tested on Windows XP Prof and Windows 7) The source of these circumstance is that some streams are not closed and so the vm couldnt delete these two files. I created a patch witch fixed this failure. The two streams according to the two temp files are now closed and the vm can erase them. I also fixed the missspelling of the two temp files: poi-sxxsf -> poi-sxssf