added an additional attempt to remove the temporary directory

This commit is contained in:
Jeremy Long
2015-08-09 10:25:30 -04:00
parent 37f50db00e
commit a543fbbec9

View File

@@ -31,6 +31,7 @@ import java.io.UnsupportedEncodingException;
import java.net.URLDecoder; import java.net.URLDecoder;
import java.util.Enumeration; import java.util.Enumeration;
import java.util.Properties; import java.util.Properties;
import java.util.logging.Level;
/** /**
* A simple settings container that wraps the dependencycheck.properties file. * A simple settings container that wraps the dependencycheck.properties file.
@@ -364,6 +365,14 @@ public final class Settings {
public static void cleanup(boolean deleteTemporary) { public static void cleanup(boolean deleteTemporary) {
if (deleteTemporary && tempDirectory != null && tempDirectory.exists()) { if (deleteTemporary && tempDirectory != null && tempDirectory.exists()) {
FileUtils.delete(tempDirectory); FileUtils.delete(tempDirectory);
if (tempDirectory.exists()) {
try {
Thread.sleep(2000);
} catch (InterruptedException ex) {
//ignore
}
FileUtils.delete(tempDirectory);
}
} }
try { try {
localSettings.remove(); localSettings.remove();