use of org.onap.sdc.tosca.parser.impl.SdcToscaParserFactory in project so by onap.
the class ToscaResourceStructure method updateResourceStructure.
public void updateResourceStructure(IArtifactInfo artifact) throws ASDCDownloadException {
try {
// Autoclosable
SdcToscaParserFactory factory = SdcToscaParserFactory.getInstance();
String filePath = Paths.get(msoConfigPath, "ASDC", artifact.getArtifactVersion(), artifact.getArtifactName()).normalize().toString();
File spoolFile = new File(filePath);
logger.debug("ASDC File path is: {}", spoolFile.getAbsolutePath());
logger.info(LoggingAnchor.FOUR, MessageEnum.ASDC_RECEIVE_SERVICE_NOTIF.toString(), "***PATH", "ASDC", spoolFile.getAbsolutePath());
sdcCsarHelper = factory.getSdcCsarHelper(spoolFile.getAbsolutePath(), false);
} catch (Exception e) {
logger.debug(e.getMessage(), e);
logger.error(LoggingAnchor.SIX, MessageEnum.ASDC_GENERAL_EXCEPTION_ARG.toString(), "Exception caught during parser *****LOOK********* " + artifact.getArtifactName(), "ASDC", "processResourceNotification", ErrorCode.BusinessProcessError.getValue(), "Exception in " + "processResourceNotification", e);
throw new ASDCDownloadException("Exception caught when passing the csar file to the parser ", e);
}
serviceMetadata = sdcCsarHelper.getServiceMetadata();
}
Aggregations