poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 53493] delete xml's temporary files when write workbook
Date Wed, 04 Jul 2012 06:55:37 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=53493

--- Comment #2 from Massimo Cavalleri <submax@tiscalinet.it> ---
(In reply to comment #1)
> Reading the patch I conclude that you can save a SXSSF workbook only once.
> That would not be correct. The earliest point in time that the a data file
> can be deleted it when it is no longer referenced. Hence I am OK with that
> part of the patch that deletes the files in Sheet.finalize(). I think that
> the part that explicitly calls Sheet.finalize() from the Workbook.write()
> should be removed.

I try to write a same workbook two time but this do not permit action and
return Exception:

Exception in thread "main" java.io.IOException: Stream closed
    at java.io.BufferedWriter.ensureOpen(BufferedWriter.java:98)
    at java.io.BufferedWriter.flushBuffer(BufferedWriter.java:108)
    at java.io.BufferedWriter.flush(BufferedWriter.java:235)
    at
org.apache.poi.xssf.streaming.SheetDataWriter.close(SheetDataWriter.java:78)
    at
org.apache.poi.xssf.streaming.SXSSFSheet.getWorksheetXMLInputStream(SXSSFSheet.java:71)
    at
org.apache.poi.xssf.streaming.SXSSFWorkbook.injectData(SXSSFWorkbook.java:295)
    at
org.apache.poi.xssf.streaming.SXSSFWorkbook.write(SXSSFWorkbook.java:767)
    at TestXlsx.main(TestXlsx.java:37)

For this reason I have insert the delete in write method. 
I understand that object's workbook can to be writed only one time.
Infact finalize() of SheetDataWriter already exist and this is private.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Mime
View raw message