--- SXSSFSheet.java (revision 1186746) +++ SXSSFSheet.java (working copy) @@ -35,6 +35,7 @@ * Streaming version of XSSFSheet implementing the "BigGridDemo" strategy. * * @author Alex Geller, Four J's Development Tools + * @author Stefan Helfert */ public class SXSSFSheet implements Sheet, Cloneable { @@ -1284,7 +1285,7 @@ public SheetDataWriter() throws IOException { - _fd = File.createTempFile("poi-sxxsf-sheet", ".xml"); + _fd = File.createTempFile("poi-sxssf-sheet", ".xml"); _fd.deleteOnExit(); _out = new BufferedWriter(new FileWriter(_fd)); } --- SXSSFWorkbook.java (revision 1186746) +++ SXSSFWorkbook.java (working copy) @@ -47,6 +47,7 @@ * Streaming version of XSSFWorkbook implementing the "BigGridDemo" strategy. * * @author Alex Geller, Four J's Development Tools + * @author Stefan Helfert */ public class SXSSFWorkbook implements Workbook { @@ -208,7 +209,7 @@ } is.close(); } - + zip.close(); //otherwise xlsx temp file cant be deleted zos.close(); } private static void copyStream(InputStream in, OutputStream out) throws IOException { @@ -316,6 +317,7 @@ while(((c=inReader.read())!=-1)) outWriter.write(c); outWriter.flush(); + worksheetData.close();//Otherwise xml-temp file cant be deleted } public XSSFWorkbook getXSSFWorkbook() @@ -649,7 +651,7 @@ } //Save the template - File tmplFile = File.createTempFile("poi-sxxsf-template", ".xlsx"); + File tmplFile = File.createTempFile("poi-sxssf-template", ".xlsx"); tmplFile.deleteOnExit(); FileOutputStream os = new FileOutputStream(tmplFile); _wb.write(os);