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:
Jeremy Long
2014-03-10 10:36:03 -04:00
parent a627ca2127
commit 35b0b684df

View File

@@ -112,7 +112,10 @@ public abstract class AbstractSuppressionAnalyzer extends AbstractAnalyzer {
final Pattern uriRx = Pattern.compile("^(https?|file)\\:.*", Pattern.CASE_INSENSITIVE);
if (uriRx.matcher(suppressionFilePath).matches()) {
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);
try {
Downloader.fetchFile(url, file, false);