Class PomUtils
- java.lang.Object
-
- org.owasp.dependencycheck.xml.pom.PomUtils
-
@ThreadSafe public final class PomUtils extends java.lang.Object
- Author:
- jeremy long
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
analyzePOM(Dependency dependency, java.io.File pomFile)
Reads in the pom file and adds elements as evidence to the given dependency.static Model
readPom(java.io.File file)
Reads in the specified POM and converts it to a Model.static Model
readPom(java.lang.String path, java.util.jar.JarFile jar)
Retrieves the specified POM from a jar file and converts it to a Model.
-
-
-
Method Detail
-
readPom
public static Model readPom(java.io.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 POMModel
object
-
readPom
public static Model readPom(java.lang.String path, java.util.jar.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 filejar
- 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 POMModel
object
-
analyzePOM
public static void analyzePOM(Dependency dependency, java.io.File pomFile) throws AnalysisException
Reads in the pom file and adds elements as evidence to the given dependency.- Parameters:
dependency
- the dependency being analyzedpomFile
- the pom file to read- Throws:
AnalysisException
- is thrown if there is an exception parsing the pom
-
-