diff options
Diffstat (limited to 'poi-examples/src')
-rw-r--r-- | poi-examples/src/main/java/org/apache/poi/examples/util/TempFileUtils.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/poi-examples/src/main/java/org/apache/poi/examples/util/TempFileUtils.java b/poi-examples/src/main/java/org/apache/poi/examples/util/TempFileUtils.java index 7d2d01b409..ac6fa02e58 100644 --- a/poi-examples/src/main/java/org/apache/poi/examples/util/TempFileUtils.java +++ b/poi-examples/src/main/java/org/apache/poi/examples/util/TempFileUtils.java @@ -19,18 +19,19 @@ package org.apache.poi.examples.util; -import java.io.File; - +import org.apache.poi.util.DefaultTempFileCreationStrategy; import org.apache.poi.util.TempFile; +import java.io.File; +import java.nio.file.Paths; + public final class TempFileUtils { private TempFileUtils() { } @SuppressWarnings("java:S106") public static void checkTempFiles() { - String tmpDir = System.getProperty(TempFile.JAVA_IO_TMPDIR) + "/poifiles"; - File tempDir = new File(tmpDir); + File tempDir = Paths.get(System.getProperty(TempFile.JAVA_IO_TMPDIR), DefaultTempFileCreationStrategy.POIFILES).toFile(); if(tempDir.exists()) { String[] tempFiles = tempDir.list(); if(tempFiles != null && tempFiles.length > 0) { |