From c0009d2cb3044f887e90402146e42472d3388828 Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Wed, 22 Jun 2011 19:11:58 +0200 Subject: Fix potential lock on Windows ? --- sonar-plugin-api/src/main/java/org/sonar/api/utils/ZipUtils.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'sonar-plugin-api') diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/utils/ZipUtils.java b/sonar-plugin-api/src/main/java/org/sonar/api/utils/ZipUtils.java index 21a7b3d7720..3e87b766f8c 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/utils/ZipUtils.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/utils/ZipUtils.java @@ -85,9 +85,12 @@ public final class ZipUtils { } FileOutputStream fos = new FileOutputStream(to); + InputStream input = null; try { - IOUtils.copy(zipFile.getInputStream(entry), fos); + input = zipFile.getInputStream(entry); + IOUtils.copy(input, fos); } finally { + IOUtils.closeQuietly(input); IOUtils.closeQuietly(fos); } } -- cgit v1.2.3