Search in sources :

Example 1 with ExeNugetInspector

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

the class NugetInspectorManager method findExeInspector.

private ExeNugetInspector findExeInspector(File nupkgFolder) throws DetectorException {
    // original inspector
    final String exeInspectorName = detectConfiguration.getProperty(DetectProperty.DETECT_NUGET_INSPECTOR_NAME, PropertyAuthority.None);
    final String exeName = exeInspectorName + ".exe";
    logger.info("Searching for: " + exeName);
    File toolsFolder = new File(nupkgFolder, "tools");
    logger.debug("Searching in: " + toolsFolder.getAbsolutePath());
    Optional<File> foundExe = detectFileFinder.findFilesToDepth(toolsFolder, exeName, 3).stream().findFirst();
    if (foundExe.isPresent() && foundExe.get().exists()) {
        String inspectorExe = foundExe.get().toString();
        logger.info("Found nuget inspector: " + inspectorExe);
        return new ExeNugetInspector(executableRunner, inspectorExe);
    } else {
        throw new DetectorException("Unable to find nuget inspector named '" + exeName + "' in " + toolsFolder.getAbsolutePath());
    }
}
Also used : ExeNugetInspector(com.blackducksoftware.integration.hub.detect.detector.nuget.inspector.ExeNugetInspector) DetectorException(com.blackducksoftware.integration.hub.detect.detector.DetectorException) File(java.io.File)

Aggregations

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