Class PomParser

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

@ThreadSafe public class PomParser extends Object
A parser for pom.xml files.
Author:
Jeremy Long
  • Constructor Details

    • PomParser

      public PomParser()
  • Method Details

    • parse

      public Model parse(File file) throws PomParseException
      Parses the given xml file and returns a Model object containing only the fields dependency-check requires. An attempt is made to remove any doctype definitions.
      Parameters:
      file - a pom.xml
      Returns:
      a Model object containing only the fields dependency-check requires
      Throws:
      PomParseException - thrown if the xml file cannot be parsed
    • parseWithoutDocTypeCleanup

      public Model parseWithoutDocTypeCleanup(File file) throws PomParseException
      Parses the given xml file and returns a Model object containing only the fields dependency-check requires. No attempt is made to remove doctype definitions.
      Parameters:
      file - a pom.xml
      Returns:
      a Model object containing only the fields dependency-check requires
      Throws:
      PomParseException - thrown if the xml file cannot be parsed
    • parse

      public Model parse(InputStream inputStream) throws PomParseException
      Parses the given XML file and returns a Model object containing only the fields dependency-check requires. An attempt is made to remove any doctype definitions.
      Parameters:
      inputStream - an InputStream containing suppression rues
      Returns:
      a list of suppression rules
      Throws:
      PomParseException - if the XML cannot be parsed
    • parseWithoutDocTypeCleanup

      public Model parseWithoutDocTypeCleanup(InputStream inputStream) throws PomParseException
      Parses the given XML file and returns a Model object containing only the fields dependency-check requires. No attempt is made to remove doctype definitions.
      Parameters:
      inputStream - an InputStream containing suppression rues
      Returns:
      a list of suppression rules
      Throws:
      PomParseException - if the XML cannot be parsed