@ThreadSafe public class Dependency extends Object implements Serializable
| Constructor and Description |
|---|
Dependency()
Constructs a new Dependency object.
|
Dependency(boolean isVirtual)
Constructs a new Dependency object.
|
Dependency(File file)
Constructs a new Dependency object.
|
Dependency(File file,
boolean isVirtual)
Constructs a new Dependency object.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addAllProjectReferences(Set<String> projectReferences)
Add a collection of project reference.
|
void |
addAsEvidence(String source,
MavenArtifact mavenArtifact,
Confidence confidence)
Adds the Maven artifact as evidence.
|
void |
addAvailableVersion(String version)
Adds a version to the available version list.
|
void |
addEvidence(EvidenceType type,
Evidence e)
Adds evidence to the collection.
|
void |
addEvidence(EvidenceType type,
String source,
String name,
String value,
Confidence confidence)
Creates an Evidence object from the parameters and adds the resulting
object to the evidence collection.
|
void |
addProductWeighting(String str)
Adds term to the product weighting collection.
|
void |
addProjectReference(String projectReference)
Adds a project reference.
|
void |
addRelatedDependency(Dependency dependency)
Adds a related dependency.
|
void |
addSoftwareIdentifier(Identifier identifier)
Adds an entry to the list of detected Identifiers for the dependency
file.
|
protected void |
addSoftwareIdentifiers(Set<Identifier> identifiers)
Adds a set of Identifiers to the current list of software identifiers.
|
void |
addSuppressedIdentifier(Identifier identifier)
Adds an identifier to the list of suppressed identifiers.
|
void |
addSuppressedVulnerabilities(List<Vulnerability> vulns)
Add a list of suppressed vulnerabilities to the collection.
|
void |
addSuppressedVulnerability(Vulnerability vulnerability)
Adds a vulnerability to the set of suppressed vulnerabilities.
|
void |
addVendorWeighting(String str)
Adds term to the vendor weighting collection.
|
void |
addVulnerabilities(List<Vulnerability> vulnerabilities)
Adds a list of vulnerabilities to the dependency.
|
void |
addVulnerability(Vulnerability vulnerability)
Adds a vulnerability to the dependency.
|
void |
addVulnerableSoftwareIdentifier(Identifier identifier)
Adds an entry to the list of detected vulnerable software identifiers for
the dependency file.
|
protected void |
addVulnerableSoftwareIdentifiers(Set<Identifier> identifiers)
Adds a set of Identifiers to the current list of vulnerable software
identifiers.
|
boolean |
contains(EvidenceType type,
Confidence confidence)
Returns whether or not the collection contains evidence of a specified
type and confidence.
|
boolean |
contains(EvidenceType type,
Evidence e)
Tests if the evidence collection contains the given evidence.
|
boolean |
equals(Object obj)
Implementation of the equals method.
|
File |
getActualFile()
Gets a reference to the File object.
|
String |
getActualFilePath()
Gets the file path of the dependency.
|
List<String> |
getAvailableVersions()
Get the value of availableVersions.
|
String |
getDescription()
Get the value of description.
|
String |
getDisplayFileName()
Returns the file name to display in reports; if no display file name has
been set it will default to constructing a name based on the name and
version fields, otherwise it will return the actual file name.
|
String |
getEcosystem() |
Set<Evidence> |
getEvidence()
Returns the unmodifiable set of evidence.
|
Set<Evidence> |
getEvidence(EvidenceType type)
Returns the unmodifiable set of evidence of the given type.
|
String |
getFileName()
Returns the file name of the dependency.
|
String |
getFilePath()
Gets the file path of the dependency.
|
Iterable<Evidence> |
getIterator(EvidenceType type,
Confidence confidence)
Used to iterate over evidence of the specified type and confidence.
|
String |
getLicense()
Get the value of license.
|
String |
getMd5sum()
Returns the MD5 Checksum of the dependency file.
|
String |
getName() |
String |
getPackagePath()
Returns the package path.
|
Set<String> |
getProductWeightings()
Returns an unmodifiable set of product Weightings - a list of terms that
are believed to be of higher confidence when also found in another
location.
|
Set<String> |
getProjectReferences()
Get the unmodifiable set of projectReferences.
|
Set<Dependency> |
getRelatedDependencies()
Get the unmodifiable set of
relatedDependencies. |
String |
getSha1sum()
Returns the SHA1 Checksum of the dependency.
|
String |
getSha256sum()
Returns the SHA256 Checksum of the dependency.
|
Set<Identifier> |
getSoftwareIdentifiers()
Returns an unmodifiable set of software identifiers.
|
Set<Identifier> |
getSuppressedIdentifiers()
Get the unmodifiable set of suppressedIdentifiers.
|
Set<Vulnerability> |
getSuppressedVulnerabilities()
Get an unmodifiable set of suppressedVulnerabilities.
|
Set<Vulnerability> |
getSuppressedVulnerabilities(boolean sorted)
Get an unmodifiable, optionally sorted.
|
Set<String> |
getVendorWeightings()
Returns an unmodifiable set of vendor Weightings - a list of terms that
are believed to be of higher confidence when also found in another
location.
|
String |
getVersion() |
Set<Vulnerability> |
getVulnerabilities()
Get the unmodifiable sorted set of vulnerabilities.
|
Set<Vulnerability> |
getVulnerabilities(boolean sorted)
Get the unmodifiable list of vulnerabilities; optionally sorted.
|
Set<Identifier> |
getVulnerableSoftwareIdentifiers()
Returns an unmodifiable set of vulnerability identifiers.
|
int |
hashCode()
Generates the HashCode.
|
boolean |
isVirtual()
Returns whether or not this dependency is virtual or not.
|
void |
removeEvidence(EvidenceType type,
Evidence e)
Removes evidence from the collection.
|
void |
removeRelatedDependencies(Dependency dependency)
Removes a related dependency.
|
void |
removeVulnerability(Vulnerability v)
Removes the given vulnerability from the list.
|
void |
removeVulnerableSoftwareIdentifier(Identifier i)
Removes a vulnerable software identifier from the set of identifiers.
|
void |
setActualFilePath(String actualFilePath)
Sets the actual file path of the dependency on disk.
|
void |
setDescription(String description)
Set the value of description.
|
void |
setDisplayFileName(String displayName)
Sets the file name to display in reports.
|
void |
setEcosystem(String ecosystem) |
void |
setFileName(String fileName)
Sets the file name of the dependency.
|
void |
setFilePath(String filePath)
Sets the file path of the dependency.
|
void |
setLicense(String license)
Set the value of license.
|
void |
setMd5sum(String md5sum)
Sets the MD5 Checksum of the dependency.
|
void |
setName(String name) |
void |
setPackagePath(String packagePath)
Sets the package path.
|
void |
setSha1sum(String sha1sum)
Sets the SHA1 Checksum of the dependency.
|
void |
setSha256sum(String sha256sum) |
void |
setVersion(String version) |
int |
size()
Returns the number of elements in the EvidenceCollection.
|
String |
toString()
Standard toString() implementation showing the filename, actualFilePath,
and filePath.
|
public Dependency()
public Dependency(File file)
file - the File to create the dependency object from.public Dependency(File file, boolean isVirtual)
file - the File to create the dependency object from.isVirtual - specifies if the dependency is virtual indicating the
file doesn't actually exist.public Dependency(boolean isVirtual)
isVirtual - specifies if the dependency is virtual indicating the
file doesn't actually exist.public String getPackagePath()
public void setPackagePath(String packagePath)
packagePath - the package pathpublic String getFileName()
public void setFileName(String fileName)
fileName - the file name of the dependencypublic String getActualFilePath()
public void setActualFilePath(String actualFilePath)
actualFilePath - the file path of the dependencypublic File getActualFile()
public String getDisplayFileName()
public void setDisplayFileName(String displayName)
displayName - the name to displaypublic String getFilePath()
Gets the file path of the dependency.
NOTE: This may not be the actual path of the file on disk. The actual path of the file on disk can be obtained via the getActualFilePath().
public void setFilePath(String filePath)
filePath - the file path of the dependencypublic String getMd5sum()
public void setMd5sum(String md5sum)
md5sum - the MD5 Checksumpublic String getSha1sum()
public void setSha1sum(String sha1sum)
sha1sum - the SHA1 Checksumpublic String getSha256sum()
public void setSha256sum(String sha256sum)
public Set<Identifier> getSoftwareIdentifiers()
public Set<Identifier> getVulnerableSoftwareIdentifiers()
protected void addSoftwareIdentifiers(Set<Identifier> identifiers)
identifiers - A set of Identifiersprotected void addVulnerableSoftwareIdentifiers(Set<Identifier> identifiers)
identifiers - A set of Identifierspublic void addSoftwareIdentifier(Identifier identifier)
identifier - a reference to the identifier to addpublic void addVulnerableSoftwareIdentifier(Identifier identifier)
identifier - a reference to the identifier to addpublic void removeVulnerableSoftwareIdentifier(Identifier i)
i - the identifier to removepublic void addAsEvidence(String source, MavenArtifact mavenArtifact, Confidence confidence)
source - The source of the evidencemavenArtifact - The Maven artifactconfidence - The confidence level of this evidencepublic Set<Identifier> getSuppressedIdentifiers()
public void addSuppressedIdentifier(Identifier identifier)
identifier - an identifier that was suppressed.public Set<Vulnerability> getVulnerabilities()
public Set<Vulnerability> getVulnerabilities(boolean sorted)
sorted - if true the list will be sortedpublic Set<Vulnerability> getSuppressedVulnerabilities()
public Set<Vulnerability> getSuppressedVulnerabilities(boolean sorted)
sorted - whether or not the set is sortedpublic void addSuppressedVulnerability(Vulnerability vulnerability)
vulnerability - the vulnerability that was suppressedpublic String getDescription()
public void setDescription(String description)
description - new value of descriptionpublic String getLicense()
public void setLicense(String license)
license - new value of licensepublic String getName()
public void setName(String name)
name - the name to setpublic void addVulnerability(Vulnerability vulnerability)
vulnerability - a vulnerabilitypublic void addVulnerabilities(List<Vulnerability> vulnerabilities)
vulnerabilities - a list of vulnerabilitiespublic void removeVulnerability(Vulnerability v)
v - the vulnerability to removepublic Set<Dependency> getRelatedDependencies()
relatedDependencies. This field is
used to collect other dependencies which really represent the same
dependency, and may be presented as one item in reports.public Set<String> getProjectReferences()
public void addProjectReference(String projectReference)
projectReference - a project referencepublic void addAllProjectReferences(Set<String> projectReferences)
projectReferences - a set of project referencespublic void addRelatedDependency(Dependency dependency)
dependency - a reference to the related dependencypublic void removeRelatedDependencies(Dependency dependency)
dependency - the dependency to removepublic List<String> getAvailableVersions()
public void addAvailableVersion(String version)
version - the version to add to the listpublic boolean isVirtual()
public boolean equals(Object obj)
obj - the object to comparepublic int hashCode()
public String toString()
public void addSuppressedVulnerabilities(List<Vulnerability> vulns)
vulns - the list of suppressed vulnerabilities to addpublic String getVersion()
public void setVersion(String version)
version - the version to setpublic String getEcosystem()
public void setEcosystem(String ecosystem)
ecosystem - the ecosystem to setpublic Iterable<Evidence> getIterator(EvidenceType type, Confidence confidence)
type - the evidence type to iterate overconfidence - the confidence level for the evidence to be iterated
over.public void addEvidence(EvidenceType type, Evidence e)
type - the type of evidence (vendor, product, version)e - Evidencepublic void removeEvidence(EvidenceType type, Evidence e)
type - the type of evidence (vendor, product, version)e - Evidence.public void addEvidence(EvidenceType type, String source, String name, String value, Confidence confidence)
type - the type of evidence (vendor, product, version)source - the source of the Evidence.name - the name of the Evidence.value - the value of the Evidence.confidence - the confidence of the Evidence.public void addVendorWeighting(String str)
str - to add to the weighting collection.public void addProductWeighting(String str)
str - to add to the weighting collection.public Set<String> getVendorWeightings()
public Set<String> getProductWeightings()
public Set<Evidence> getEvidence(EvidenceType type)
type - the type of evidence (vendor, product, version)public Set<Evidence> getEvidence()
public boolean contains(EvidenceType type, Evidence e)
type - the type of evidence (vendor, product, version)e - the evidence to searchpublic boolean contains(EvidenceType type, Confidence confidence)
type - the type of evidence (vendor, product, version)confidence - A Confidence value.public int size()
Copyright © 2012–2020 OWASP. All rights reserved.