diff options
author | Tal Gitelman <tg851x@intl.att.com> | 2018-01-04 16:11:30 +0200 |
---|---|---|
committer | Michael Lando <ml636r@att.com> | 2018-01-07 16:34:13 +0000 |
commit | 9542ec5708daad3dd43052d326780f7f5c9a987d (patch) | |
tree | ff2c1e881d15383b20727b7c50412b7e7dcc915e /src/main/java | |
parent | eed89a056e2c51bfbc1df78995f757f3d1ed8231 (diff) |
CSAR files are decompressed twice
in the same thread fixed
Change-Id: Id59cc7250d8431114ab90d14e03049f86a4d49ca
Issue-ID: SDC-250
Signed-off-by: Tal Gitelman <tg851x@intl.att.com>
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/org/openecomp/sdc/toscaparser/api/ToscaTemplate.java | 4 | ||||
-rw-r--r-- | src/main/java/org/openecomp/sdc/toscaparser/api/prereq/CSAR.java | 9 |
2 files changed, 7 insertions, 6 deletions
diff --git a/src/main/java/org/openecomp/sdc/toscaparser/api/ToscaTemplate.java b/src/main/java/org/openecomp/sdc/toscaparser/api/ToscaTemplate.java index 07cce1c..8d7d130 100644 --- a/src/main/java/org/openecomp/sdc/toscaparser/api/ToscaTemplate.java +++ b/src/main/java/org/openecomp/sdc/toscaparser/api/ToscaTemplate.java @@ -172,8 +172,7 @@ public class ToscaTemplate extends Object { //log.info(msg) log.debug("ToscaTemplate - Both path and yaml_dict_tpl arguments were provided. Using path and ignoring yaml_dict_tpl"); } - } - else { + } else { // no input to process... _abort(); } @@ -225,6 +224,7 @@ public class ToscaTemplate extends Object { verifyTemplate(); throw new JToscaException("jtosca aborting", JToscaErrorCodes.PATH_NOT_VALID.getValue()); } + private TopologyTemplate _topologyTemplate() { return new TopologyTemplate( _tplTopologyTemplate(), diff --git a/src/main/java/org/openecomp/sdc/toscaparser/api/prereq/CSAR.java b/src/main/java/org/openecomp/sdc/toscaparser/api/prereq/CSAR.java index b40eded..b64bd9a 100644 --- a/src/main/java/org/openecomp/sdc/toscaparser/api/prereq/CSAR.java +++ b/src/main/java/org/openecomp/sdc/toscaparser/api/prereq/CSAR.java @@ -54,7 +54,6 @@ public class CSAR { metaProperties = new LinkedHashMap<>(); } - @SuppressWarnings("unchecked") public boolean validate() throws JToscaException { isValidated = true; @@ -310,9 +309,11 @@ public class CSAR { if(!isValidated) { validate(); } - tempDir = Files.createTempDirectory("JTP").toString(); - unzip(path,tempDir); - + + if(tempDir == null || tempDir.isEmpty()) { + tempDir = Files.createTempDirectory("JTP").toString(); + unzip(path,tempDir); + } } private void _validateExternalReferences() throws JToscaException { |