From 41b02ea1f4183df5394421948f664d89e1a56ec1 Mon Sep 17 00:00:00 2001 From: romaingimbert Date: Fri, 24 May 2019 11:09:37 +0200 Subject: permissions failing when tosca parsing -fix dockerfile -add check in sdcclient Change-Id: I84fcbf6289a692168def37ee50c3c3b33945e15f Issue-ID: EXTAPI-249 Signed-off-by: romaingimbert --- src/main/java/org/onap/nbi/apis/servicecatalog/SdcClient.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/main') diff --git a/src/main/java/org/onap/nbi/apis/servicecatalog/SdcClient.java b/src/main/java/org/onap/nbi/apis/servicecatalog/SdcClient.java index 0be415c..2e6893d 100644 --- a/src/main/java/org/onap/nbi/apis/servicecatalog/SdcClient.java +++ b/src/main/java/org/onap/nbi/apis/servicecatalog/SdcClient.java @@ -92,7 +92,6 @@ public class SdcClient { String callUrl = sdcGetUrl.replace("{id}", id); UriComponentsBuilder callURLFormated = UriComponentsBuilder.fromHttpUrl(callUrl); - ResponseEntity response = callSdc(callURLFormated.build().encode().toUri()); return (LinkedHashMap) response.getBody(); @@ -130,8 +129,12 @@ public class SdcClient { UriComponentsBuilder callURI = UriComponentsBuilder.fromHttpUrl(urlBuilder.toString()); + File directory = new File("temptoscafile"); + if (! directory.exists()){ + directory.mkdir(); + } - String fileName = System.currentTimeMillis() + "tosca.csar"; + String fileName = "temptoscafile/"+System.currentTimeMillis() + "tosca.csar"; ResponseEntity response = callSdcWithAttachment(callURI.build().encode().toUri()); File toscaFile = new File(fileName); try { @@ -178,6 +181,7 @@ public class SdcClient { private ResponseEntity callSdc(URI callURI) { ResponseEntity response = restTemplate.exchange(callURI, HttpMethod.GET, buildRequestHeader(), Object.class); + if(LOGGER.isDebugEnabled()) { LOGGER.debug("response body : {} ",response.getBody().toString()); } -- cgit 1.2.3-korg