Class LPVSDetectService

java.lang.Object
com.lpvs.service.scan.LPVSDetectService

@Service public class LPVSDetectService extends Object
Service class for detecting licenses in GitHub pull requests using a specified scanner.
  • Constructor Details

    • LPVSDetectService

      @Autowired public LPVSDetectService(@Value("${scanner:scanoss}") String scannerType, @Value("${internal:false}") boolean isInternal, LPVSGitHubConnectionService gitHubConnectionService, LPVSLicenseService licenseService, LPVSGitHubService gitHubService, LPVSScanServiceFactory scanServiceFactory)
      Constructs an instance of LPVSDetectService with the specified parameters.
      Parameters:
      scannerType - The type of license detection scanner.
      isInternal - Flag indicating whether the scanner is internal or not.
      gitHubConnectionService - Service for connecting to the GitHub API.
      licenseService - Service for license conflict analysis.
      gitHubService - Service for GitHub connection and operation.
      scanServiceFactory - Service for creating instance of the scanner.
  • Method Details

    • runOneScan

      @EventListener(org.springframework.boot.context.event.ApplicationReadyEvent.class) public void runOneScan()
      Event listener method triggered when the application is ready, runs a single license scan if triggered.
    • runScan

      public List<LPVSFile> runScan(LPVSQueue webhookConfig, String path) throws Exception
      Runs a license scan based on the selected scanner type.
      Parameters:
      webhookConfig - LPVSQueue configuration for the scan.
      path - Local directory path for the scan.
      Returns:
      List of LPVSFile objects representing the scan results.
      Throws:
      Exception - if an error occurs during the scan.