diff options
author | Simon Brandhof <simon.brandhof@gmail.com> | 2011-06-22 19:11:58 +0200 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@gmail.com> | 2011-06-22 19:11:58 +0200 |
commit | c0009d2cb3044f887e90402146e42472d3388828 (patch) | |
tree | 8fc3d51c32eb7d117c67410b223c34f9eacfb4cd /sonar-plugin-api | |
parent | 4b2abd7208b4d3364e53acd6b90c5d14783fa93c (diff) | |
download | sonarqube-c0009d2cb3044f887e90402146e42472d3388828.tar.gz sonarqube-c0009d2cb3044f887e90402146e42472d3388828.zip |
Fix potential lock on Windows ?
Diffstat (limited to 'sonar-plugin-api')
-rw-r--r-- | sonar-plugin-api/src/main/java/org/sonar/api/utils/ZipUtils.java | 5 |
1 files changed, 4 insertions, 1 deletions
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); } } |