diff options
author | Avi Gaffa <avi.gaffa@amdocs.com> | 2017-10-23 14:14:53 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2017-10-23 14:14:53 +0000 |
commit | 6bcb1b6ce1ee3e905ac0bfdbe5938c70b20604fc (patch) | |
tree | bbb54b59b0c72099fc555f3ccb4ca8977957d4a2 /openecomp-be | |
parent | 37d5b2c858f9f17bef12c170895e9ac03d50cf05 (diff) | |
parent | d4e5d3c532f6d71cc3ff79047068ff904972ea42 (diff) |
Merge "Artifacts in CSAR"
Diffstat (limited to 'openecomp-be')
2 files changed, 15 insertions, 2 deletions
diff --git a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/datatypes/CsarFileTypes.java b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/datatypes/CsarFileTypes.java index 323bd8a5fb..d17f79bb6c 100644 --- a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/datatypes/CsarFileTypes.java +++ b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-api/src/main/java/org/openecomp/core/converter/datatypes/CsarFileTypes.java @@ -5,5 +5,6 @@ public enum CsarFileTypes { globalServiceTemplate, externalFile, toscaMetadata, - definitionsFile,; + definitionsFile, + Artifacts; } diff --git a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src/main/java/org/openecomp/core/impl/ToscaConverterImpl.java b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src/main/java/org/openecomp/core/impl/ToscaConverterImpl.java index 348739e780..9b694c5207 100644 --- a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src/main/java/org/openecomp/core/impl/ToscaConverterImpl.java +++ b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src/main/java/org/openecomp/core/impl/ToscaConverterImpl.java @@ -54,7 +54,8 @@ public class ToscaConverterImpl implements ToscaConverter { break; case externalFile: - artifacts.addFile(fileEntry.getKey(), fileEntry.getValue()); + artifacts.addFile( + getConcreteArtifactFileName(fileEntry.getKey()), fileEntry.getValue()); break; case definitionsFile: @@ -94,6 +95,17 @@ public class ToscaConverterImpl implements ToscaConverter { } } + 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, |