From 4b02a567e03cb8d5e895b1bb812db52516d5bdea Mon Sep 17 00:00:00 2001 From: Jeremy Long Date: Sat, 8 Oct 2016 18:00:18 -0400 Subject: [PATCH] improved error reporting --- .../org/owasp/dependencycheck/analyzer/JarAnalyzer.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dependency-check-core/src/main/java/org/owasp/dependencycheck/analyzer/JarAnalyzer.java b/dependency-check-core/src/main/java/org/owasp/dependencycheck/analyzer/JarAnalyzer.java index 67e371f62..374333485 100644 --- a/dependency-check-core/src/main/java/org/owasp/dependencycheck/analyzer/JarAnalyzer.java +++ b/dependency-check-core/src/main/java/org/owasp/dependencycheck/analyzer/JarAnalyzer.java @@ -932,8 +932,11 @@ public class JarAnalyzer extends AbstractFileTypeAnalyzer { if (tempFileLocation != null && tempFileLocation.exists()) { LOGGER.debug("Attempting to delete temporary files"); final boolean success = FileUtils.delete(tempFileLocation); - if (!success) { - LOGGER.warn("Failed to delete some temporary files, see the log for more details"); + if (!success && tempFileLocation.exists()) { + final String[] l = tempFileLocation.list(); + if (l != null && l.length > 0) { + LOGGER.warn("Failed to delete some temporary files, see the log for more details"); + } } } }