do not set deleteOnExit if sys prop set to false

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1922788 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
PJ Fanning 2024-12-30 21:48:22 +00:00
parent 9951e8dfc1
commit 75729edcea

View File

@ -83,8 +83,8 @@ public class DefaultTempFileCreationStrategy implements TempFileCreationStrategy
// Generate a unique new filename
File newFile = Files.createTempFile(dir.toPath(), prefix, suffix).toFile();
// Set the delete on exit flag, but only when explicitly disabled
if (System.getProperty(DELETE_FILES_ON_EXIT) != null) {
// Set the delete on exit flag if requested
if (Boolean.getBoolean(DELETE_FILES_ON_EXIT)) {
newFile.deleteOnExit();
}