From f3c53ad39bf85d8e808c3e53189f077ad7c95f47 Mon Sep 17 00:00:00 2001 From: Alexis de Talhouët Date: Sat, 22 Sep 2018 23:53:51 -0400 Subject: Add .casr suffix to downloaded csar file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit SdcToscaParserFactory is looking file file type of .yaml .yml .zip or .csar As no suffix was provided, .tmp was being appended, hence the process was failing to parse the csar file. Change-Id: Ia87bb1e2402f94e44f6cbf3e28beb2adea52db4d Issue-ID: POLICY-1146 Signed-off-by: Alexis de Talhouët --- .../policy/distribution/reception/handling/sdc/SdcReceptionHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins/reception-plugins/src') diff --git a/plugins/reception-plugins/src/main/java/org/onap/policy/distribution/reception/handling/sdc/SdcReceptionHandler.java b/plugins/reception-plugins/src/main/java/org/onap/policy/distribution/reception/handling/sdc/SdcReceptionHandler.java index 2ada9fcd..0d100f8f 100644 --- a/plugins/reception-plugins/src/main/java/org/onap/policy/distribution/reception/handling/sdc/SdcReceptionHandler.java +++ b/plugins/reception-plugins/src/main/java/org/onap/policy/distribution/reception/handling/sdc/SdcReceptionHandler.java @@ -260,7 +260,7 @@ public class SdcReceptionHandler extends AbstractReceptionHandler implements INo final IDistributionClientDownloadResult resultArtifact) throws ArtifactDownloadException { try { final byte[] payloadBytes = resultArtifact.getArtifactPayload(); - final File tempArtifactFile = File.createTempFile(artifact.getArtifactName(), null); + final File tempArtifactFile = File.createTempFile(artifact.getArtifactName(), ".csar"); try (FileOutputStream fileOutputStream = new FileOutputStream(tempArtifactFile)) { fileOutputStream.write(payloadBytes, 0, payloadBytes.length); return tempArtifactFile.toPath(); -- cgit 1.2.3-korg