aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-plugin-api
diff options
context:
space:
mode:
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);
}
}