Class LPVSScanossDetectService

java.lang.Object
com.lpvs.service.scan.scanner.LPVSScanossDetectService
All Implemented Interfaces:
LPVSScanService

@Service public class LPVSScanossDetectService extends Object implements LPVSScanService
Service class responsible for interacting with the Scanoss scanner to scan licenses in files. It handles the initiation of the scan, processing scan results, and checking for license conflicts.
  • Constructor Details

    • LPVSScanossDetectService

      @Autowired public LPVSScanossDetectService(@Value("${debug:false}") Boolean debug, LPVSLicenseService licenseService, LPVSLicenseRepository lpvsLicenseRepository)
      Constructor for LPVSScanossDetectService.
      Parameters:
      debug - Flag indicating whether the application is in debug mode.
      licenseService - The LPVSLicenseService for license-related operations.
      lpvsLicenseRepository - The repository for LPVSLicense entities.
  • Method Details

    • runScan

      public void runScan(LPVSQueue webhookConfig, String path) throws Exception
      Initiates the Scanoss scan for the specified LPVSQueue and file path.
      Specified by:
      runScan in interface LPVSScanService
      Parameters:
      webhookConfig - The LPVSQueue representing the GitHub webhook configuration.
      path - The file path to be scanned.
      Throws:
      Exception - If an error occurs during the scanning process.
    • checkLicenses

      public List<LPVSFile> checkLicenses(LPVSQueue webhookConfig)
      Checks the licenses detected by Scanoss and returns a list of LPVSFile entities.
      Specified by:
      checkLicenses in interface LPVSScanService
      Parameters:
      webhookConfig - The LPVSQueue representing the GitHub webhook configuration.
      Returns:
      A list of LPVSFile entities representing detected files and their licenses.