Search in sources :

Example 1 with VndrParser

use of com.synopsys.integration.detectable.detectables.go.vendr.parse.VndrParser in project synopsys-detect by blackducksoftware.

the class GoVndrExtractor method extract.

public Extraction extract(File vndrConfig) {
    try {
        VndrParser vndrParser = new VndrParser(externalIdFactory);
        List<String> vendorConfContents = Files.readAllLines(vndrConfig.toPath(), StandardCharsets.UTF_8);
        logger.debug(String.join("\n", vendorConfContents));
        DependencyGraph dependencyGraph = vndrParser.parseVendorConf(vendorConfContents);
        CodeLocation codeLocation = new CodeLocation(dependencyGraph);
        return new Extraction.Builder().success(codeLocation).build();
    } catch (Exception e) {
        return new Extraction.Builder().exception(e).build();
    }
}
Also used : CodeLocation(com.synopsys.integration.detectable.detectable.codelocation.CodeLocation) VndrParser(com.synopsys.integration.detectable.detectables.go.vendr.parse.VndrParser) DependencyGraph(com.synopsys.integration.bdio.graph.DependencyGraph) Extraction(com.synopsys.integration.detectable.extraction.Extraction)

Aggregations

DependencyGraph (com.synopsys.integration.bdio.graph.DependencyGraph)1 CodeLocation (com.synopsys.integration.detectable.detectable.codelocation.CodeLocation)1 VndrParser (com.synopsys.integration.detectable.detectables.go.vendr.parse.VndrParser)1 Extraction (com.synopsys.integration.detectable.extraction.Extraction)1