+ List<String> relevantArtifactTypes = sdcConfig.getRelevantArtifactTypes();
+ Path path = Paths.get("/data");
+ List<VfModuleModel> vfModuleModels = null;
+ Map<String, IArtifactInfo> artifactMap = null;//key is UUID, value is artifact for shared folder
+ String vfArtifactData = null;
+
+ for (final IArtifactInfo artifact : resource.getArtifacts()) {
+ artifactMap.put(artifact.getArtifactUUID(),artifact);
+
+ //extract the artifactlist and write them into MongoDB
+ if (artifact.getArtifactType().equals("VF_MODULES_METADATA")) {
+ try {
+ final IDistributionClientDownloadResult resultArtifact =
+ downloadTheArtifact(artifact,notificationData);
+ vfArtifactData = new String(resultArtifact.getArtifactPayload());
+ vfModuleModels= GsonUtil.parseJsonArrayWithGson(vfArtifactData,VfModuleModel.class);
+ } catch (final ArtifactDownloadException exp) {
+ LOGGER.error("Failed to process csar service artifacts ", exp);
+ artifactsProcessedSuccessfully = false;
+ sendDistributionStatus(DistributionStatusType.DEPLOY, artifact.getArtifactURL(),
+ notificationData.getDistributionID(), DistributionStatusEnum.DEPLOY_ERROR,
+ "Failed to deploy the artifact due to: " + exp.getMessage());
+ }
+ }
+ }
+
+ //foreach(vf_module_metadata)
+ // 1. create a dir like /data/UUID1
+ // 2. put the vfmodule-meta.json into it
+ // 3. put the service-meta.json into it
+ // 3. go through each aritfact uuid under artifact_list of vf_module and download
+ for (final VfModuleModel vfModule : vfModuleModels) {