aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/common/FileUtil.java7
1 files changed, 2 insertions, 5 deletions
diff --git a/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/common/FileUtil.java b/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/common/FileUtil.java
index 87fb75b6..642fc8f0 100644
--- a/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/common/FileUtil.java
+++ b/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/common/FileUtil.java
@@ -125,11 +125,8 @@ public final class FileUtil {
InputStream input = zipFile.getInputStream(entry);
BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(file));
) {
- while (true) {
- int length = input.read(buffer);
- if (length == -1) {
- break;
- }
+ int length = 0;
+ while ((length = input.read(buffer)) != -1) {
bos.write(buffer, 0, length);
}
unzipFileNams.add(file.getAbsolutePath());