aboutsummaryrefslogtreecommitdiffstats
path: root/poi-examples
diff options
context:
space:
mode:
Diffstat (limited to 'poi-examples')
-rw-r--r--poi-examples/src/main/java/org/apache/poi/examples/ss/ConditionalFormats.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/poi-examples/src/main/java/org/apache/poi/examples/ss/ConditionalFormats.java b/poi-examples/src/main/java/org/apache/poi/examples/ss/ConditionalFormats.java
index db65f76787..a0a8177e87 100644
--- a/poi-examples/src/main/java/org/apache/poi/examples/ss/ConditionalFormats.java
+++ b/poi-examples/src/main/java/org/apache/poi/examples/ss/ConditionalFormats.java
@@ -19,8 +19,10 @@
package org.apache.poi.examples.ss;
-import java.io.FileOutputStream;
import java.io.IOException;
+import java.io.OutputStream;
+import java.nio.file.Files;
+import java.nio.file.Paths;
import java.util.List;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
@@ -93,7 +95,7 @@ public final class ConditionalFormats {
if (wb instanceof XSSFWorkbook) {
file += "x";
}
- try (FileOutputStream out = new FileOutputStream(file)) {
+ try (OutputStream out = Files.newOutputStream(Paths.get(file))) {
wb.write(out);
}
System.out.println("Generated: " + file);