use of com.blackducksoftware.integration.hub.exception.HubIntegrationException in project hub-docker-inspector by blackducksoftware.
the class Output method uploadBdioFiles.
private String uploadBdioFiles(final Config config) throws IntegrationException {
String pathToDirContainingBdio = null;
pathToDirContainingBdio = programPaths.getHubDockerOutputPath();
logger.debug(String.format("Uploading BDIO files from %s", pathToDirContainingBdio));
String bdioFilename = null;
final List<File> bdioFiles = findBdioFiles(pathToDirContainingBdio);
if (bdioFiles.size() == 0) {
logger.warn("No BDIO Files generated");
} else if (bdioFiles.size() > 1) {
throw new HubIntegrationException(String.format("Found %d BDIO files in %s", bdioFiles.size(), pathToDirContainingBdio));
} else {
bdioFilename = bdioFiles.get(0).getName();
logger.info(String.format("Uploading BDIO to Hub: %d files; first file: %s", bdioFiles.size(), bdioFiles.get(0).getAbsolutePath()));
uploadBdioFiles(bdioFiles);
}
return bdioFilename;
}
Aggregations