Search in sources :

Example 1 with DotNetCoreNugetInspector

use of com.blackducksoftware.integration.hub.detect.detector.nuget.inspector.DotNetCoreNugetInspector in project hub-detect by blackducksoftware.

the class NugetInspectorManager method findDotnetCoreInspector.

private DotNetCoreNugetInspector findDotnetCoreInspector(File nupkgFolder, String dotnetExecutable) throws DetectorException {
    // new inspector
    final String dotnetInspectorName = "BlackduckNugetInspector.dll";
    logger.info("Searching for: " + dotnetInspectorName);
    File toolsFolder = new File(nupkgFolder, "tools");
    Optional<File> foundExe = detectFileFinder.findFilesToDepth(toolsFolder, dotnetInspectorName, 3).stream().findFirst();
    if (foundExe.isPresent() && foundExe.get().exists()) {
        String inspectorExe = foundExe.get().toString();
        logger.info("Found nuget inspector: " + inspectorExe);
        return new DotNetCoreNugetInspector(dotnetExecutable, inspectorExe, executableRunner);
    } else {
        throw new DetectorException("Unable to find nuget inspector, looking for " + dotnetInspectorName + " in " + toolsFolder.toString());
    }
}
Also used : DetectorException(com.blackducksoftware.integration.hub.detect.detector.DetectorException) File(java.io.File) DotNetCoreNugetInspector(com.blackducksoftware.integration.hub.detect.detector.nuget.inspector.DotNetCoreNugetInspector)

Aggregations

DetectorException (com.blackducksoftware.integration.hub.detect.detector.DetectorException)1 DotNetCoreNugetInspector (com.blackducksoftware.integration.hub.detect.detector.nuget.inspector.DotNetCoreNugetInspector)1 File (java.io.File)1