aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-plugin-api
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@gmail.com>2011-06-22 19:11:58 +0200
committerSimon Brandhof <simon.brandhof@gmail.com>2011-06-22 19:11:58 +0200
commitc0009d2cb3044f887e90402146e42472d3388828 (patch)
tree8fc3d51c32eb7d117c67410b223c34f9eacfb4cd /sonar-plugin-api
parent4b2abd7208b4d3364e53acd6b90c5d14783fa93c (diff)
downloadsonarqube-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.java5
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);
}
}