mirror of
https://github.com/ysoftdevs/DependencyCheck.git
synced 2026-03-11 21:05:38 +01:00
updated to delete newly created file prior to attempting to copy a new file into its location
Former-commit-id: 584dc6abeab388acf65ab3d5379616005746db6b
This commit is contained in:
@@ -112,7 +112,10 @@ public abstract class AbstractSuppressionAnalyzer extends AbstractAnalyzer {
|
|||||||
final Pattern uriRx = Pattern.compile("^(https?|file)\\:.*", Pattern.CASE_INSENSITIVE);
|
final Pattern uriRx = Pattern.compile("^(https?|file)\\:.*", Pattern.CASE_INSENSITIVE);
|
||||||
if (uriRx.matcher(suppressionFilePath).matches()) {
|
if (uriRx.matcher(suppressionFilePath).matches()) {
|
||||||
deleteTempFile = true;
|
deleteTempFile = true;
|
||||||
file = File.createTempFile("suppression", "xml", Settings.getTempDirectory());
|
file = File.createTempFile("suppression", ".xml", Settings.getTempDirectory());
|
||||||
|
if (file.exists()) {
|
||||||
|
file.delete();
|
||||||
|
}
|
||||||
final URL url = new URL(suppressionFilePath);
|
final URL url = new URL(suppressionFilePath);
|
||||||
try {
|
try {
|
||||||
Downloader.fetchFile(url, file, false);
|
Downloader.fetchFile(url, file, false);
|
||||||
|
|||||||
Reference in New Issue
Block a user