Class PomUtils

java.lang.Object
org.owasp.dependencycheck.xml.pom.PomUtils

@ThreadSafe public final class PomUtils extends Object
Author:
jeremy long
  • Method Details

    • readPom

      public static Model readPom(File file) throws AnalysisException
      Reads in the specified POM and converts it to a Model.
      Parameters:
      file - the pom.xml file
      Returns:
      returns an object representation of the POM
      Throws:
      AnalysisException - is thrown if there is an exception extracting or parsing the POM Model object
    • readPom

      public static Model readPom(String path, JarFile jar) throws AnalysisException
      Retrieves the specified POM from a jar file and converts it to a Model.
      Parameters:
      path - the path to the pom.xml file within the jar file
      jar - the jar file to extract the pom from
      Returns:
      returns an object representation of the POM
      Throws:
      AnalysisException - is thrown if there is an exception extracting or parsing the POM Model object
    • analyzePOM

      public static void analyzePOM(Dependency dependency, File pomFile) throws AnalysisException
      Reads in the pom file and adds elements as evidence to the given dependency.
      Parameters:
      dependency - the dependency being analyzed
      pomFile - the pom file to read
      Throws:
      AnalysisException - is thrown if there is an exception parsing the pom