Fix CSAR generation default imports file conflict 70/123770/3
authorandre.schmid <andre.schmid@est.tech>
Wed, 1 Sep 2021 16:37:19 +0000 (17:37 +0100)
committerMichael Morris <michael.morris@est.tech>
Fri, 3 Sep 2021 14:14:19 +0000 (14:14 +0000)
commit9534496497b037f4bfb26603f91b54f41e65774a
tree896ff1751242d4e7b20d8f184735b002be9e2b6b
parent84e478592488c8bcbc01b820b3862ce0d839a7bd
Fix CSAR generation default imports file conflict

When generating a CSAR for a resource that is associated with a
derived model, the default imports for the derived and parent model
can conflict in path, therefore causing an issue during the CSAR
zip generation which can't stand two entries with the same path.

The fix adds a logic to rename a file when conflicting, by adding
the model id as the file prefix.

Change-Id: Ife7168f1c69f90be9c2cfd8ba75efad316c477f6
Issue-ID: SDC-3710
Signed-off-by: andre.schmid <andre.schmid@est.tech>
catalog-be/src/main/java/org/openecomp/sdc/be/tosca/CsarUtils.java
catalog-be/src/main/java/org/openecomp/sdc/be/tosca/ToscaDefaultImportHelper.java [new file with mode: 0644]
catalog-be/src/main/java/org/openecomp/sdc/be/tosca/ToscaExportHandler.java
catalog-be/src/test/java/org/openecomp/sdc/be/tosca/ToscaDefaultImportHelperTest.java [new file with mode: 0644]
catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/ModelOperation.java