Class DescriptionEcosystemMapper

java.lang.Object
org.owasp.dependencycheck.data.nvd.ecosystem.DescriptionEcosystemMapper

public class DescriptionEcosystemMapper extends Object
Helper utility for mapping CVEs to their ecosystems based on the description.
Author:
skjolber
  • Constructor Details

    • DescriptionEcosystemMapper

      public DescriptionEcosystemMapper()
      Constructs a new description ecosystem mapper.
  • Method Details

    • getPrefixesFor

      protected static boolean[] getPrefixesFor(String str)
    • toAhoCorasickDoubleArrayTrie

      protected static StringAhoCorasickDoubleArrayTrie<EcosystemHint> toAhoCorasickDoubleArrayTrie()
    • isExtension

      protected static boolean isExtension(String str, int begin, int end)
    • isLowercaseAscii

      protected static boolean isLowercaseAscii(String multicase, int start, int end)
    • isURL

      public static boolean isURL(String c, int begin)
      Tests if the string is a URL by looking for '://'.
      Parameters:
      c - the text to test.
      begin - the position in the string to begin searching; note the search is decreasing to 0
      Returns:
      true if `://` is found; otherwise false
    • increment

      protected void increment(int i, int[] ecosystemMap)
    • getEcosystem

      public String getEcosystem(io.github.jeremylong.openvulnerability.client.nvd.DefCveItem cve)
      Returns the ecosystem if identified by English description from the CVE data.
      Parameters:
      cve - the CVE data
      Returns:
      the ecosystem if identified
    • getEcosystem

      public String getEcosystem(String multicase)
      Determines the ecosystem for the given string.
      Parameters:
      multicase - the string to test
      Returns:
      the ecosystem