diff --git a/dependency-check-utils/src/main/java/org/owasp/dependencycheck/utils/Settings.java b/dependency-check-utils/src/main/java/org/owasp/dependencycheck/utils/Settings.java index cc5469a27..94d7c65a4 100644 --- a/dependency-check-utils/src/main/java/org/owasp/dependencycheck/utils/Settings.java +++ b/dependency-check-utils/src/main/java/org/owasp/dependencycheck/utils/Settings.java @@ -337,7 +337,7 @@ public final class Settings { */ public static void cleanup(boolean deleteTemporary) { if (deleteTemporary && tempDirectory != null && tempDirectory.exists()) { - FileUtils.delete(tempDirectory); + //FileUtils.delete(tempDirectory); } try { localSettings.remove(); @@ -586,15 +586,14 @@ public final class Settings { * @throws java.io.IOException thrown if the temporary directory does not exist and cannot be created */ public static File getTempDirectory() throws IOException { - final File tmpDir = new File(Settings.getString(Settings.KEYS.TEMP_DIRECTORY, System.getProperty("java.io.tmpdir"))); + final File tmpDir = new File(Settings.getString(Settings.KEYS.TEMP_DIRECTORY, System.getProperty("java.io.tmpdir")), "dctemp"); if (!tmpDir.exists()) { if (!tmpDir.mkdirs()) { final String msg = String.format("Unable to make a temporary folder '%s'", tmpDir.getPath()); throw new IOException(msg); - } else { - tempDirectory = tmpDir; } } + tempDirectory = tmpDir; return tmpDir; }