Search in sources :

Example 1 with GoVendorJsonParser

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

the class GoVendorExtractor method extract.

public Extraction extract(File vendorJsonFile) {
    try {
        GoVendorJsonParser vendorJsonParser = new GoVendorJsonParser(externalIdFactory);
        String vendorJsonContents = FileUtils.readFileToString(vendorJsonFile, StandardCharsets.UTF_8);
        logger.debug(vendorJsonContents);
        DependencyGraph dependencyGraph = vendorJsonParser.parseVendorJson(gson, vendorJsonContents);
        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) GoVendorJsonParser(com.synopsys.integration.detectable.detectables.go.vendor.parse.GoVendorJsonParser) 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 GoVendorJsonParser (com.synopsys.integration.detectable.detectables.go.vendor.parse.GoVendorJsonParser)1 Extraction (com.synopsys.integration.detectable.extraction.Extraction)1