diff options
author | Avi Gaffa <avi.gaffa@amdocs.com> | 2017-10-24 08:08:47 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2017-10-24 08:08:47 +0000 |
commit | 5e41e2b9bf6bfb3d5ff0bb9858ee6424ba8c22e0 (patch) | |
tree | 05cfe37d3545bc32f0583833076b0471e6da40a7 | |
parent | cec9123e81b2c8fc0be59915757fbdb17c84f296 (diff) | |
parent | 3f5c26360697f80b803796a4a2a1dde4fa676546 (diff) |
Merge "Artifacts in CSAR" into release-1.1.0
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 f38d7f2b06..55f92aa11a 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, |