mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-03-17 23:04:07 +01:00
added an additional attempt to remove the temporary directory
This commit is contained in:
@@ -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();
|
||||||
|
|||||||
Reference in New Issue
Block a user