summaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authorMatthieu Geerebaert <matthieu.geerebaert@orange.com>2019-05-24 13:05:31 +0000
committerGerrit Code Review <gerrit@onap.org>2019-05-24 13:05:31 +0000
commita0dfe9bc184690949719896036e8c5b34681d425 (patch)
tree3e86327e7107343375d8efa0e7339c54b3e2a6cd /src/main
parent822e3c812b1b2abdd310de060a023081c48f69b5 (diff)
parent41b02ea1f4183df5394421948f664d89e1a56ec1 (diff)
Merge "permissions failing when tosca parsing"
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/onap/nbi/apis/servicecatalog/SdcClient.java8
1 files changed, 6 insertions, 2 deletions
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<Object> 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<byte[]> response = callSdcWithAttachment(callURI.build().encode().toUri());
File toscaFile = new File(fileName);
try {
@@ -178,6 +181,7 @@ public class SdcClient {
private ResponseEntity<Object> callSdc(URI callURI) {
ResponseEntity<Object> response =
restTemplate.exchange(callURI, HttpMethod.GET, buildRequestHeader(), Object.class);
+
if(LOGGER.isDebugEnabled()) {
LOGGER.debug("response body : {} ",response.getBody().toString());
}