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());
}
}
Aggregations