]> source.dussan.org Git - sonarqube.git/commitdiff
Fix potential lock on Windows ?
authorSimon Brandhof <simon.brandhof@gmail.com>
Wed, 22 Jun 2011 17:11:58 +0000 (19:11 +0200)
committerSimon Brandhof <simon.brandhof@gmail.com>
Wed, 22 Jun 2011 17:11:58 +0000 (19:11 +0200)
sonar-plugin-api/src/main/java/org/sonar/api/utils/ZipUtils.java

index 21a7b3d77206ff13b44cf387546dbed14cec334e..3e87b766f8c0e18629ad074eb6eb1d58dda75237 100644 (file)
@@ -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);
             }
           }