diff options
author | 2016-10-20 06:10:49 +0000 | |
---|---|---|
committer | 2016-10-20 06:10:49 +0000 | |
commit | 203cfc217785597c768652dc6be40da145d07ea7 (patch) | |
tree | 227809de358bc75d89c27f834471f4c10c77dc28 /catalog-core/catalog-mgr/src/main/java | |
parent | af44bcb938d898ffc02b485d0cd55cebab297c8c (diff) | |
parent | 328db7b2150d2cecd2f2087214f210c3168b18db (diff) |
Merge "Modify File.separator to '/' for temporary csar uri."
Diffstat (limited to 'catalog-core/catalog-mgr/src/main/java')
4 files changed, 18 insertions, 3 deletions
diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/AbstractModelParser.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/AbstractModelParser.java index 09c3e127..2c40f832 100644 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/AbstractModelParser.java +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/AbstractModelParser.java @@ -63,7 +63,7 @@ public abstract class AbstractModelParser { } protected String toTempFilePath(String fileLocation) { - return File.separator + "temp" + File.separator + (new File(fileLocation)).getName(); + return "/temp/" + (new File(fileLocation)).getName(); } protected EnumTemplateType getTemplateType(String substitutionType, List<NodeTemplate> ntList) { @@ -106,7 +106,7 @@ public abstract class AbstractModelParser { protected String parseServiceTemplateFileName(String packageId, String fileLocation) throws CatalogResourceException { - return File.separator + parseToscaMeta(fileLocation).get(TOSCA_META_FIELD_ENTRY_DEFINITIONS); + return "/" + parseToscaMeta(fileLocation).get(TOSCA_META_FIELD_ENTRY_DEFINITIONS); } private static final String TOSCA_META_FILE_NAME = "TOSCA-Metadata/TOSCA.meta"; diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/yaml/aria/AriaModelParser.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/yaml/aria/AriaModelParser.java index 49c1fcf1..ae8aaaed 100644 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/yaml/aria/AriaModelParser.java +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/yaml/aria/AriaModelParser.java @@ -36,6 +36,8 @@ import org.openo.commontosca.catalog.model.parser.yaml.aria.entity.AriaParserRes import org.openo.commontosca.catalog.model.parser.yaml.aria.entity.AriaParserResult.Substitution.Mapping; import org.openo.commontosca.catalog.model.parser.yaml.aria.service.AriaParserServiceConsumer; import org.openo.commontosca.catalog.wrapper.PackageWrapper; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import java.util.ArrayList; import java.util.HashMap; @@ -48,12 +50,15 @@ import java.util.Map.Entry; * */ public class AriaModelParser extends AbstractModelParser { + private static final Logger logger = LoggerFactory.getLogger(AriaModelParser.class); /* (non-Javadoc) * @see org.openo.commontosca.catalog.model.parser.AbstractModelParser#parse(java.lang.String, java.lang.String) */ @Override public String parse(String packageId, String fileLocation) throws CatalogResourceException { + logger.info("Parse begin."); + String stFileLocation = parseServiceTemplateFileName(packageId, fileLocation); AriaParserResult result = getAriaParserResult(packageId, fileLocation, stFileLocation); diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/yaml/aria/service/AriaParserServiceConsumer.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/yaml/aria/service/AriaParserServiceConsumer.java index deae1101..4eb61d45 100644 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/yaml/aria/service/AriaParserServiceConsumer.java +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/yaml/aria/service/AriaParserServiceConsumer.java @@ -21,13 +21,18 @@ import org.openo.commontosca.catalog.db.exception.CatalogResourceException; import org.openo.commontosca.catalog.model.parser.yaml.aria.entity.AriaParserExceptionResult; import org.openo.commontosca.catalog.model.parser.yaml.aria.entity.AriaParserRequest; import org.openo.commontosca.catalog.model.parser.yaml.aria.entity.AriaParserResult; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import com.eclipsesource.jaxrs.consumer.ConsumerFactory; import com.google.gson.Gson; public class AriaParserServiceConsumer { + private static final Logger logger = LoggerFactory.getLogger(AriaParserServiceConsumer.class); + public static AriaParserResult parseCsarPackage(String uri) throws CatalogResourceException { + logger.info("parseCsarPackage uri = " + uri); return parseCsarPackage(new AriaParserRequest(uri, null)); } /** diff --git a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/yaml/zte/service/YamlParseServiceConsumer.java b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/yaml/zte/service/YamlParseServiceConsumer.java index b90a61bc..d6e9286e 100644 --- a/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/yaml/zte/service/YamlParseServiceConsumer.java +++ b/catalog-core/catalog-mgr/src/main/java/org/openo/commontosca/catalog/model/parser/yaml/zte/service/YamlParseServiceConsumer.java @@ -23,9 +23,12 @@ import org.openo.commontosca.catalog.common.MsbUtil; import org.openo.commontosca.catalog.db.exception.CatalogResourceException; import org.openo.commontosca.catalog.model.parser.yaml.zte.entity.ParseYamlRequestParemeter; import org.openo.commontosca.catalog.model.parser.yaml.zte.entity.ParseYamlResult; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class YamlParseServiceConsumer { + private static final Logger logger = LoggerFactory.getLogger(YamlParseServiceConsumer.class); /** * get service template by template id from container service. * @@ -33,8 +36,10 @@ public class YamlParseServiceConsumer { * @return parase yaml result * @throws CatalogResourceException e */ - public static ParseYamlResult getServiceTemplates(final ParseYamlRequestParemeter request) + public static ParseYamlResult getServiceTemplates(ParseYamlRequestParemeter request) throws CatalogResourceException { + logger.info("parseCsarPackage uri = " + request.getPath()); + try { ClientConfig config = new ClientConfig(); IYamlParseRest yamlParseProxy = |