use of com.blackducksoftware.integration.hub.detect.detector.DetectorException 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());
}
}
use of com.blackducksoftware.integration.hub.detect.detector.DetectorException in project hub-detect by blackducksoftware.
the class NugetInspectorManager method findNugetInspector.
public NugetInspector findNugetInspector() throws DetectorException {
try {
if (!hasResolvedInspector) {
hasResolvedInspector = true;
resolvedNugetInspector = install();
}
return resolvedNugetInspector;
} catch (final Exception e) {
throw new DetectorException(e);
}
}
use of com.blackducksoftware.integration.hub.detect.detector.DetectorException in project hub-detect by blackducksoftware.
the class PipInspectorManager method findPipInspector.
public File findPipInspector(final DetectorEnvironment environment) throws DetectorException {
try {
if (!hasResolvedInspector) {
hasResolvedInspector = true;
resolvedInspector = installInspector();
}
return resolvedInspector;
} catch (final Exception e) {
throw new DetectorException(e);
}
}
Aggregations