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
|
//writeAvoidingTempFiles was added as an experimental change in POI 5.1.0
|
||||||
//wb.writeAvoidingTempFiles(fileOut);
|
//wb.writeAvoidingTempFiles(fileOut);
|
||||||
} finally {
|
} finally {
|
||||||
|
//the dispose call is necessary to ensure temp files are removed
|
||||||
wb.dispose();
|
wb.dispose();
|
||||||
}
|
}
|
||||||
System.out.println("wrote DeferredGeneration.xlsx");
|
System.out.println("wrote DeferredGeneration.xlsx");
|
||||||
|
|
|
@ -47,6 +47,7 @@ public class Outlining {
|
||||||
try (FileOutputStream fileOut = new FileOutputStream("outlining_collapsed.xlsx")) {
|
try (FileOutputStream fileOut = new FileOutputStream("outlining_collapsed.xlsx")) {
|
||||||
wb2.write(fileOut);
|
wb2.write(fileOut);
|
||||||
} finally {
|
} finally {
|
||||||
|
//the dispose call is necessary to ensure temp files are removed
|
||||||
wb2.dispose();
|
wb2.dispose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -80,6 +80,7 @@ public final class SavePasswordProtectedXlsx {
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
wb.close();
|
wb.close();
|
||||||
|
//the dispose call is necessary to ensure temp files are removed
|
||||||
wb.dispose();
|
wb.dispose();
|
||||||
}
|
}
|
||||||
TempFileUtils.checkTempFiles();
|
TempFileUtils.checkTempFiles();
|
||||||
|
|
|
@ -152,6 +152,9 @@ public class SheetDataWriter implements Closeable {
|
||||||
*/
|
*/
|
||||||
public InputStream getWorksheetXMLInputStream() throws IOException {
|
public InputStream getWorksheetXMLInputStream() throws IOException {
|
||||||
File fd = getTempFile();
|
File fd = getTempFile();
|
||||||
|
if (fd == null) {
|
||||||
|
throw new IOException("getWorksheetXMLInputStream only works when a temp file is used");
|
||||||
|
}
|
||||||
FileInputStream fis = new FileInputStream(fd);
|
FileInputStream fis = new FileInputStream(fd);
|
||||||
try {
|
try {
|
||||||
return decorateInputStream(fis);
|
return decorateInputStream(fis);
|
||||||
|
|
Loading…
Reference in New Issue