public String generateBlackDuckNoticesReport ( ProjectVersionView version , ReportFormatType reportFormat ) throws InterruptedException , IntegrationException { if ( version . hasLink ( ProjectVersionView . LICENSEREPORTS_LINK ) ) { try { logger . debug ( "Starting the Notices Report generation." ) ; String reportUrl = startGeneratingBlackDuckNoticesReport ( version , reportFormat ) ; logger . debug ( "Waiting for the Notices Report to complete." ) ; ReportView reportInfo = isReportFinishedGenerating ( reportUrl ) ; String contentLink = reportInfo . getFirstLink ( ReportView . CONTENT_LINK ) . orElse ( null ) ; if ( contentLink == null ) { throw new BlackDuckIntegrationException ( "Could not find content link for the report at : " + reportUrl ) ; } logger . debug ( "Getting the Notices Report content." ) ; String noticesReport = getNoticesReportContent ( contentLink ) ; logger . debug ( "Finished retrieving the Notices Report." ) ; logger . debug ( "Cleaning up the Notices Report on the server." ) ; deleteBlackDuckReport ( reportUrl ) ; return noticesReport ; } catch ( IntegrationRestException e ) { if ( e . getHttpStatusCode ( ) == 402 ) { // unlike the policy module, the licenseReports link is still present when the module is not enabled logger . warn ( "Can not create the notice report, the Black Duck notice module is not enabled." ) ; } else { throw e ; } } } else { logger . warn ( "Can not create the notice report, the Black Duck notice module is not enabled." ) ; } return null ; }
Assumes the BOM has already been updated