https://bz.apache.org/bugzilla/show_bug.cgi?id=68183

            Bug ID: 68183
           Summary: SXSSFWorkbook should dispose of temporary files when
                    close() is called
           Product: POI
           Version: 5.3.x-dev
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: SXSSF
          Assignee: dev@poi.apache.org
          Reporter: claytonb1...@gmail.com
  Target Milestone: ---

Created attachment 39390
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=39390&action=edit
Proof-of-concept git diff of the change required to implement this feature

SXSSFWorkbooks create temporary files to back the workbook on disk. To get rid
of those temporary files, a user is required to explicitly call the
SXSSFWorkbook#dispose method otherwise those temporary files will not be
cleaned up.

Workbooks are auto-closable so it would improve the developer experience if the
SXSSFWorkbook#close method would call the SXSSFWorkbook#dispose method so that
users don't need to always explicitly call SXSSFWorkbook#dispose.

For example, if this were implemented a user using a try-with-resources
statement like this would always ensure that the temporary files are cleaned
up:

try (Workbook wb = new SXSSFWorkbook()) {
    // create the sheets, rows, cells, etc.
    wb.write(oStream);
}



Attached is a git diff of this proposal with some accompanying Javadoc changes.
It might also make sense to deprecate the SXSSFWorkbook#dispose method
altogether and encourage users to just call SXSSFWorkbook#close but I didn't
include that in the git diff.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@poi.apache.org
For additional commands, e-mail: dev-h...@poi.apache.org

Reply via email to