diff options
author | 2023-05-02 16:13:29 +0100 | |
---|---|---|
committer | 2023-05-02 16:13:29 +0100 | |
commit | d06f19333fda2865ed7a5beffa278daaba0f6aa3 (patch) | |
tree | d1f15203257b9b2d1183ae6e0c852df2106075d0 /so-cnfm/so-cnfm-lcm/so-cnfm-lcm-bpmn-flows/src/main | |
parent | 2710810d1e058b9442bbb8b3f7d468a5ab31955a (diff) |
Fixed the CSAR file processing when the contents of the CSAR file is in alphabetical order (Definitions/asd.yaml file before TOSCA-Metadata/TOSCA.meta).
Issue-ID: SO-4098
Signed-off-by: aravind.est <aravindhan.a@est.tech>
Change-Id: I0e9c0730825eca4069ac4cb0f7ae2f97ed56efaf
Diffstat (limited to 'so-cnfm/so-cnfm-lcm/so-cnfm-lcm-bpmn-flows/src/main')
-rw-r--r-- | so-cnfm/so-cnfm-lcm/so-cnfm-lcm-bpmn-flows/src/main/java/org/onap/so/cnfm/lcm/bpmn/flows/extclients/sdc/SdcCsarPackageParser.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/so-cnfm/so-cnfm-lcm/so-cnfm-lcm-bpmn-flows/src/main/java/org/onap/so/cnfm/lcm/bpmn/flows/extclients/sdc/SdcCsarPackageParser.java b/so-cnfm/so-cnfm-lcm/so-cnfm-lcm-bpmn-flows/src/main/java/org/onap/so/cnfm/lcm/bpmn/flows/extclients/sdc/SdcCsarPackageParser.java index c06d42f..cc4b783 100644 --- a/so-cnfm/so-cnfm-lcm/so-cnfm-lcm-bpmn-flows/src/main/java/org/onap/so/cnfm/lcm/bpmn/flows/extclients/sdc/SdcCsarPackageParser.java +++ b/so-cnfm/so-cnfm-lcm/so-cnfm-lcm-bpmn-flows/src/main/java/org/onap/so/cnfm/lcm/bpmn/flows/extclients/sdc/SdcCsarPackageParser.java @@ -70,9 +70,11 @@ public class SdcCsarPackageParser { public Map<String, Object> getAsdProperties(final byte[] onapPackage) { try (final ByteArrayInputStream stream = new ByteArrayInputStream(onapPackage); - final ZipInputStream zipInputStream = new ZipInputStream(stream);) { - final String asdLocation = getAsdLocation(zipInputStream); - final String onapAsdContent = getFileInZip(zipInputStream, asdLocation).toString(); + final ZipInputStream zipInputStreamAsdLocation = new ZipInputStream(stream); + final ZipInputStream zipInputStreamAsdContent = new ZipInputStream(stream);) { + final String asdLocation = getAsdLocation(zipInputStreamAsdLocation); + stream.reset(); + final String onapAsdContent = getFileInZip(zipInputStreamAsdContent, asdLocation).toString(); logger.debug("ASD CONTENTS: {}", onapAsdContent); final JsonObject root = new Gson().toJsonTree(new Yaml().load(onapAsdContent)).getAsJsonObject(); |