From f154826749b95f62b09cfbf55d0d870b9b33685f Mon Sep 17 00:00:00 2001 From: Jeremy Long Date: Tue, 25 Nov 2014 05:57:02 -0500 Subject: [PATCH] added additionial verbose logging Former-commit-id: 5d65d0186914d7045b6e5d51c10bc2feb8b2aab4 --- .../dependencycheck/analyzer/ArchiveAnalyzer.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/dependency-check-core/src/main/java/org/owasp/dependencycheck/analyzer/ArchiveAnalyzer.java b/dependency-check-core/src/main/java/org/owasp/dependencycheck/analyzer/ArchiveAnalyzer.java index c406185db..32a1dff72 100644 --- a/dependency-check-core/src/main/java/org/owasp/dependencycheck/analyzer/ArchiveAnalyzer.java +++ b/dependency-check-core/src/main/java/org/owasp/dependencycheck/analyzer/ArchiveAnalyzer.java @@ -338,7 +338,7 @@ public class ArchiveAnalyzer extends AbstractFileTypeAnalyzer { try { fis.close(); } catch (IOException ex) { - LOGGER.log(Level.FINEST, null, ex); + LOGGER.log(Level.FINE, null, ex); } } } @@ -367,8 +367,10 @@ public class ArchiveAnalyzer extends AbstractFileTypeAnalyzer { final File file = new File(destination, entry.getName()); final String ext = FileUtils.getFileExtension(file.getName()); if (engine.supportsExtension(ext)) { + final String extracting = String.format("Extracting '%s'", file.getPath()); + LOGGER.fine(extracting); BufferedOutputStream bos = null; - FileOutputStream fos; + FileOutputStream fos = null; try { final File parent = file.getParentFile(); if (!parent.isDirectory()) { @@ -401,6 +403,13 @@ public class ArchiveAnalyzer extends AbstractFileTypeAnalyzer { LOGGER.log(Level.FINEST, null, ex); } } + if (fos != null) { + try { + fos.close(); + } catch (IOException ex) { + LOGGER.log(Level.FINEST, null, ex); + } + } } } } @@ -428,6 +437,8 @@ public class ArchiveAnalyzer extends AbstractFileTypeAnalyzer { * @throws ArchiveExtractionException thrown if there is an exception decompressing the file */ private void decompressFile(CompressorInputStream inputStream, File outputFile) throws ArchiveExtractionException { + final String msg = String.format("Decompressing '%s'", outputFile.getPath()); + LOGGER.fine(msg); FileOutputStream out = null; try { out = new FileOutputStream(outputFile);