- path = createTempFile(csarArchive);
- if (path != null) {
- ISdcCsarHelper csarHelper =
- SdcToscaParserFactory.getInstance().getSdcCsarHelper(path.toAbsolutePath().toString());
+ try {
+ ArtifactGeneratorToscaParser.initWidgetConfiguration();
+ ArtifactGeneratorToscaParser.initGroupFilterConfiguration();
+ ISdcCsarHelper csarHelper =
+ SdcToscaParserFactory.getInstance().getSdcCsarHelper(csarPath.toAbsolutePath().toString());
+ return generateService(validateServiceVersion(additionalParams), csarHelper);
+ } catch (Exception e) {
+ log.error(ApplicationMsgs.INVALID_CSAR_FILE, e);
+ return createErrorData(e);
+ } finally {
+ FileUtils.deleteQuietly(csarPath.toFile());
+ }
+ }