Search in sources :

Example 11 with DetectorException

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());
    }
}
Also used : ExeNugetInspector(com.blackducksoftware.integration.hub.detect.detector.nuget.inspector.ExeNugetInspector) DetectorException(com.blackducksoftware.integration.hub.detect.detector.DetectorException) File(java.io.File)

Example 12 with DetectorException

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);
    }
}
Also used : DetectorException(com.blackducksoftware.integration.hub.detect.detector.DetectorException) IntegrationException(com.synopsys.integration.exception.IntegrationException) DetectUserFriendlyException(com.blackducksoftware.integration.hub.detect.exception.DetectUserFriendlyException) DetectorException(com.blackducksoftware.integration.hub.detect.detector.DetectorException) IOException(java.io.IOException)

Example 13 with DetectorException

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);
    }
}
Also used : DetectorException(com.blackducksoftware.integration.hub.detect.detector.DetectorException) IOException(java.io.IOException) DetectorException(com.blackducksoftware.integration.hub.detect.detector.DetectorException)

Aggregations

DetectorException (com.blackducksoftware.integration.hub.detect.detector.DetectorException)13 File (java.io.File)8 IOException (java.io.IOException)5 DetectUserFriendlyException (com.blackducksoftware.integration.hub.detect.exception.DetectUserFriendlyException)4 IntegrationException (com.synopsys.integration.exception.IntegrationException)3 ExecutableRunnerException (com.blackducksoftware.integration.hub.detect.util.executable.ExecutableRunnerException)2 Detector (com.blackducksoftware.integration.hub.detect.detector.Detector)1 DetectorEnvironment (com.blackducksoftware.integration.hub.detect.detector.DetectorEnvironment)1 DetectorType (com.blackducksoftware.integration.hub.detect.detector.DetectorType)1 DotNetCoreNugetInspector (com.blackducksoftware.integration.hub.detect.detector.nuget.inspector.DotNetCoreNugetInspector)1 ExeNugetInspector (com.blackducksoftware.integration.hub.detect.detector.nuget.inspector.ExeNugetInspector)1 ExitCodeType (com.blackducksoftware.integration.hub.detect.exitcode.ExitCodeType)1 ExecutableOutput (com.blackducksoftware.integration.hub.detect.util.executable.ExecutableOutput)1 DetectorEvaluation (com.blackducksoftware.integration.hub.detect.workflow.search.result.DetectorEvaluation)1 DetectorSearchRuleSet (com.blackducksoftware.integration.hub.detect.workflow.search.rules.DetectorSearchRuleSet)1 Files (java.nio.file.Files)1 Path (java.nio.file.Path)1 ArrayList (java.util.ArrayList)1 HashSet (java.util.HashSet)1 List (java.util.List)1