diff options
author | Murali Mohan Murthy Potham <murali.p@huawei.com> | 2017-09-20 05:17:30 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2017-09-20 05:17:30 +0000 |
commit | d4678af330009bcea6559874219bf3945a4cda3e (patch) | |
tree | 3222d32eb73249d0f58c3d9438c719dffe8fd8f0 /vnfmarket-be/vnf-sdk-marketplace/src/main/java | |
parent | 981e6a8d0fc885acea9c6571ceaa5d58278cf536 (diff) | |
parent | 1c03192977cf0eb18c3b595711c4d47f91077568 (diff) |
Merge "refactor unzip in FileUtil"
Diffstat (limited to 'vnfmarket-be/vnf-sdk-marketplace/src/main/java')
-rw-r--r-- | vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/common/FileUtil.java | 7 |
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()); |