log.warn("Invalid Application Channel, unable to find a ChannelImporter implementation.");
return null;
}
// pick the appropriate parser
ChannelImporter importer = channelImporterFactory.getChannelImporter(applicationChannel);
if (importer == null) {
log.warn("Unable to find suitable ChannelImporter implementation for "
+ applicationChannel.getChannelType().getName()
+ ". Returning null.");
return null;
}
updateJobStatus(statusId, "Parsing findings from " +
applicationChannel.getChannelType().getName() + " scan file.");
log.info("Processing file " + fileName + " on channel "
+ applicationChannel.getChannelType().getName() + ".");
importer.setFileName(fileName);
Scan scan = importer.parseInput();
if (scan == null) {
log.warn("The " + applicationChannel.getChannelType().getName()
+ " import failed for file " + fileName + ".");
return null;
}
updateJobStatus(statusId, "Findings successfully parsed, starting channel merge.");
scanMerger.merge(scan, applicationChannel);
scanDao.saveOrUpdate(scan);
vulnerabilityFilterService.updateVulnerabilities(
applicationChannel.getApplication().getOrganization().getId(),
applicationChannel.getApplication().getId());
importer.deleteScanFile();
vulnerabilityService.updateVulnerabilityReport(applicationChannel.getApplication());
return scan;
}