pack all artifact files under Artifacts/ directory, and not under Artifacts/Artifacts (in import CSAR scenario)
Issue - Id : SDC-495
Change-Id: I65299d449ed87a6fb492a802c40e1ab12535453a
Signed-off-by: talio <tali.orenbach@amdocs.com>
(cherry picked from commit
d4e5d3c532f6d71cc3ff79047068ff904972ea42)
globalServiceTemplate,
externalFile,
toscaMetadata,
globalServiceTemplate,
externalFile,
toscaMetadata,
+ definitionsFile,
+ Artifacts;
break;
case externalFile:
break;
case externalFile:
- artifacts.addFile(fileEntry.getKey(), fileEntry.getValue());
+ artifacts.addFile(
+ getConcreteArtifactFileName(fileEntry.getKey()), fileEntry.getValue());
break;
case definitionsFile:
break;
case definitionsFile:
+ private String getConcreteArtifactFileName(String fileName){
+ int artifactIndex = fileName.indexOf(CsarFileTypes.Artifacts.name());
+ if(artifactIndex < 0){
+ return fileName;
+ }
+
+ int artifactDirectoryIndex =
+ artifactIndex + CsarFileTypes.Artifacts.name().length() + 1;
+ return fileName.substring(artifactDirectoryIndex);
+ }
+
private void updateToscaServiceModel(ToscaServiceModel toscaServiceModel,
Map<String, ServiceTemplate> serviceTemplates,
FileContentHandler externalFilesHandler,
private void updateToscaServiceModel(ToscaServiceModel toscaServiceModel,
Map<String, ServiceTemplate> serviceTemplates,
FileContentHandler externalFilesHandler,