aboutsummaryrefslogtreecommitdiffstats
path: root/poi-examples/src/main
diff options
context:
space:
mode:
authorPJ Fanning <fanningpj@apache.org>2021-10-22 18:09:26 +0000
committerPJ Fanning <fanningpj@apache.org>2021-10-22 18:09:26 +0000
commit5d79f841bbb513f9499647c9bd0bc6d1d9bdfafc (patch)
tree3f43654ef744980f572585bd2bac3854458ba995 /poi-examples/src/main
parent7416d8035a8e8c4308bf88c9cef61a8a92f809f7 (diff)
downloadpoi-5d79f841bbb513f9499647c9bd0bc6d1d9bdfafc.tar.gz
poi-5d79f841bbb513f9499647c9bd0bc6d1d9bdfafc.zip
remove finalizer
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1894490 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poi-examples/src/main')
-rw-r--r--poi-examples/src/main/java/org/apache/poi/examples/xssf/streaming/DeferredGeneration.java1
-rw-r--r--poi-examples/src/main/java/org/apache/poi/examples/xssf/streaming/Outlining.java1
-rw-r--r--poi-examples/src/main/java/org/apache/poi/examples/xssf/streaming/SavePasswordProtectedXlsx.java1
3 files changed, 3 insertions, 0 deletions
diff --git a/poi-examples/src/main/java/org/apache/poi/examples/xssf/streaming/DeferredGeneration.java b/poi-examples/src/main/java/org/apache/poi/examples/xssf/streaming/DeferredGeneration.java
index e5b5eba6f1..1b98bb26ab 100644
--- a/poi-examples/src/main/java/org/apache/poi/examples/xssf/streaming/DeferredGeneration.java
+++ b/poi-examples/src/main/java/org/apache/poi/examples/xssf/streaming/DeferredGeneration.java
@@ -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");
diff --git a/poi-examples/src/main/java/org/apache/poi/examples/xssf/streaming/Outlining.java b/poi-examples/src/main/java/org/apache/poi/examples/xssf/streaming/Outlining.java
index 6c29813edd..31b15dcb16 100644
--- a/poi-examples/src/main/java/org/apache/poi/examples/xssf/streaming/Outlining.java
+++ b/poi-examples/src/main/java/org/apache/poi/examples/xssf/streaming/Outlining.java
@@ -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();
}
}
diff --git a/poi-examples/src/main/java/org/apache/poi/examples/xssf/streaming/SavePasswordProtectedXlsx.java b/poi-examples/src/main/java/org/apache/poi/examples/xssf/streaming/SavePasswordProtectedXlsx.java
index df5b7004cf..aabfd5955c 100644
--- a/poi-examples/src/main/java/org/apache/poi/examples/xssf/streaming/SavePasswordProtectedXlsx.java
+++ b/poi-examples/src/main/java/org/apache/poi/examples/xssf/streaming/SavePasswordProtectedXlsx.java
@@ -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();