mirror of https://github.com/apache/poi.git
remove finalizer
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1894490 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
7416d8035a
commit
5d79f841bb
|
@ -56,6 +56,7 @@ public class DeferredGeneration {
|
|||
//writeAvoidingTempFiles was added as an experimental change in POI 5.1.0
|
||||
//wb.writeAvoidingTempFiles(fileOut);
|
||||
} finally {
|
||||
//the dispose call is necessary to ensure temp files are removed
|
||||
wb.dispose();
|
||||
}
|
||||
System.out.println("wrote DeferredGeneration.xlsx");
|
||||
|
|
|
@ -47,6 +47,7 @@ public class Outlining {
|
|||
try (FileOutputStream fileOut = new FileOutputStream("outlining_collapsed.xlsx")) {
|
||||
wb2.write(fileOut);
|
||||
} finally {
|
||||
//the dispose call is necessary to ensure temp files are removed
|
||||
wb2.dispose();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -80,6 +80,7 @@ public final class SavePasswordProtectedXlsx {
|
|||
}
|
||||
} finally {
|
||||
wb.close();
|
||||
//the dispose call is necessary to ensure temp files are removed
|
||||
wb.dispose();
|
||||
}
|
||||
TempFileUtils.checkTempFiles();
|
||||
|
|
|
@ -152,6 +152,9 @@ public class SheetDataWriter implements Closeable {
|
|||
*/
|
||||
public InputStream getWorksheetXMLInputStream() throws IOException {
|
||||
File fd = getTempFile();
|
||||
if (fd == null) {
|
||||
throw new IOException("getWorksheetXMLInputStream only works when a temp file is used");
|
||||
}
|
||||
FileInputStream fis = new FileInputStream(fd);
|
||||
try {
|
||||
return decorateInputStream(fis);
|
||||
|
|
Loading…
Reference in New Issue