Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.owasp.dependencycheck.dependency
Class Dependency

    java.lang.Object
      org.owasp.dependencycheck.dependency.Dependency

All Implemented Interfaces:
  Comparable<Dependency>

    public class Dependency

extends Object
implements Comparable<Dependency>

A program dependency. This object is one of the core components within DependencyCheck. It is used to collect information about the dependency in the form of evidence. The Evidence is then used to determine if there are any known, published, vulnerabilities associated with the program dependency.

Author:
  Jeremy Long (jeremy.long@owasp.org)

Constructor Summary
`Dependency()` Constructs a new Dependency object.
`Dependency(File file)` Constructs a new Dependency object.

Method Summary
`void` | `addAnalysisException(Exception ex)` Adds an exception to the analysis exceptions collection.
`void` | `addIdentifier(Identifier identifier)` Adds an entry to the list of detected Identifiers for the dependency file.
`void` | `addIdentifier(String type, String value, String url)` Adds an entry to the list of detected Identifiers for the dependency file.
`void` | `addRelatedDependency(Dependency dependency)` Adds a related dependency.
`void` | `addVulnerability(Vulnerability vulnerability)` Adds a vulnerability to the dependency.
`int` | `compareTo(Dependency o)` Implementation of the Comparable interface.
`boolean` | `equals(Object obj)` Implementation of the equals method.
`String` | `getActualFilePath()` Gets the file path of the dependency.
`List<Exception>` | `getAnalysisExceptions()` Get the value of analysisExceptions.
`String` | `getDescription()` Get the value of description.
`EvidenceCollection` | `getEvidence()` Returns the evidence used to identify this dependency.
`EvidenceCollection` | `getEvidenceUsed()` Returns the evidence used to identify this dependency.
`String` | `getFileExtension()` Gets the file extension of the dependency.
`String` | `getFileName()` Returns the file name of the dependency.
`String` | `getFilePath()` Gets the file path of the dependency.
`Set<Identifier>` | `getIdentifiers()` Returns a List of Identifiers.
`String` | `getLicense()` Get the value of license.
`String` | `getMd5sum()` Returns the MD5 Checksum of the dependency file.
`EvidenceCollection` | `getProductEvidence()` Gets the Product Evidence.
`Set<Dependency>` | `getRelatedDependencies()` Get the value of relatedDependencies.
`String` | `getSha1sum()` Returns the SHA1 Checksum of the dependency.
`EvidenceCollection` | `getVendorEvidence()` Gets the Vendor Evidence.
`EvidenceCollection` | `getVersionEvidence()` Gets the Version Evidence.
`SortedSet<Vulnerability>` | `getVulnerabilities()` Get the list of vulnerabilities.
`int` | `hashCode()` Generates the HashCode.
`void` | `setActualFilePath(String actualFilePath)` Sets the actual file path of the dependency on disk.
`void` | `setAnalysisExceptions(List<Exception> analysisExceptions)` Set the value of analysisExceptions.
`void` | `setDescription(String description)` Set the value of description.
`void` | `setFileExtension(String fileExtension)` Sets the file name of the dependency.
`void` | `setFileName(String fileName)` Sets the file name of the dependency.
`void` | `setFilePath(String filePath)` Sets the file path of the dependency.
`void` | `setIdentifiers(Set<Identifier> identifiers)` Sets a List of Identifiers.
`void` | `setLicense(String license)` Set the value of license.
`void` | `setMd5sum(String md5sum)` Sets the MD5 Checksum of the dependency.
`void` | `setRelatedDependencies(Set<Dependency> relatedDependencies)` Set the value of relatedDependencies.
`void` | `setSha1sum(String sha1sum)` Sets the SHA1 Checksum of the dependency.
`void` | `setVulnerabilities(SortedSet<Vulnerability> vulnerabilities)` Set the value of vulnerabilities.
`String` | `toString()` Standard toString() implementation showing the filename, actualFilePath, and filePath.

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

Constructor Detail

### Dependency

    public Dependency()

  Constructs a new Dependency object.

### Dependency

    public Dependency(File file)

  Constructs a new Dependency object.

  Parameters:
    `file` - the File to create the dependency object from.

Method Detail

### getFileName

    public String getFileName()

  Returns the file name of the dependency.

  Returns:
    the file name of the dependency.

### setFileName

    public void setFileName(String fileName)

  Sets the file name of the dependency.

  Parameters:
    `fileName` - the file name of the dependency.

### setActualFilePath

    public void setActualFilePath(String actualFilePath)

  Sets the actual file path of the dependency on disk.

  Parameters:
    `actualFilePath` - the file path of the dependency.

### getActualFilePath

    public String getActualFilePath()

  Gets the file path of the dependency.

  Returns:
    the file path of the dependency.

### setFilePath

    public void setFilePath(String filePath)

  Sets the file path of the dependency.

  Parameters:
    `filePath` - the file path of the dependency.

### getFilePath

    public 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().

  Returns:
    the file path of the dependency.

### setFileExtension

    public void setFileExtension(String fileExtension)

  Sets the file name of the dependency.

  Parameters:
    `fileExtension` - the file name of the dependency.

### getFileExtension

    public String getFileExtension()

  Gets the file extension of the dependency.

  Returns:
    the file extension of the dependency.

### getMd5sum

    public String getMd5sum()

  Returns the MD5 Checksum of the dependency file.

  Returns:
    the MD5 Checksum

### setMd5sum

    public void setMd5sum(String md5sum)

  Sets the MD5 Checksum of the dependency.

  Parameters:
    `md5sum` - the MD5 Checksum

### getSha1sum

    public String getSha1sum()

  Returns the SHA1 Checksum of the dependency.

  Returns:
    the SHA1 Checksum

### setSha1sum

    public void setSha1sum(String sha1sum)

  Sets the SHA1 Checksum of the dependency.

  Parameters:
    `sha1sum` - the SHA1 Checksum

### getIdentifiers

    public Set<Identifier> getIdentifiers()

  Returns a List of Identifiers.

  Returns:
    an ArrayList of Identifiers.

### setIdentifiers

    public void setIdentifiers(Set<Identifier> identifiers)

  Sets a List of Identifiers.

  Parameters:
    `identifiers` - A list of Identifiers.

### addIdentifier

    public void addIdentifier(String type,
                              String value,
                              String url)

  Adds an entry to the list of detected Identifiers for the dependency file.

  Parameters:
    `type` - the type of identifier (such as CPE)
    `value` - the value of the identifier
    `url` - the URL of the identifier

### addIdentifier

    public void addIdentifier(Identifier identifier)

  Adds an entry to the list of detected Identifiers for the dependency file.

  Parameters:
    `identifier` - the identifier to add

### getEvidence

    public EvidenceCollection getEvidence()

  Returns the evidence used to identify this dependency.

  Returns:
    an EvidenceCollection.

### getEvidenceUsed

    public EvidenceCollection getEvidenceUsed()

  Returns the evidence used to identify this dependency.

  Returns:
    an EvidenceCollection.

### getVendorEvidence

    public EvidenceCollection getVendorEvidence()

  Gets the Vendor Evidence.

  Returns:
    an EvidenceCollection.

### getProductEvidence

    public EvidenceCollection getProductEvidence()

  Gets the Product Evidence.

  Returns:
    an EvidenceCollection.

### getVersionEvidence

    public EvidenceCollection getVersionEvidence()

  Gets the Version Evidence.

  Returns:
    an EvidenceCollection.

### getAnalysisExceptions

    public List<Exception> getAnalysisExceptions()

  Get the value of analysisExceptions.

  Returns:
    the value of analysisExceptions

### setAnalysisExceptions

    public void setAnalysisExceptions(List<Exception> analysisExceptions)

  Set the value of analysisExceptions.

  Parameters:
    `analysisExceptions` - new value of analysisExceptions

### addAnalysisException

    public void addAnalysisException(Exception ex)

  Adds an exception to the analysis exceptions collection.

  Parameters:
    `ex` - an exception.

### getDescription

    public String getDescription()

  Get the value of description.

  Returns:
    the value of description

### setDescription

    public void setDescription(String description)

  Set the value of description.

  Parameters:
    `description` - new value of description

### getLicense

    public String getLicense()

  Get the value of license.

  Returns:
    the value of license

### setLicense

    public void setLicense(String license)

  Set the value of license.

  Parameters:
    `license` - new value of license

### getVulnerabilities

    public SortedSet<Vulnerability> getVulnerabilities()

  Get the list of vulnerabilities.

  Returns:
    the list of vulnerabilities

### setVulnerabilities

    public void setVulnerabilities(SortedSet<Vulnerability> vulnerabilities)

  Set the value of vulnerabilities.

  Parameters:
    `vulnerabilities` - new value of vulnerabilities

### addVulnerability

    public void addVulnerability(Vulnerability vulnerability)

  Adds a vulnerability to the dependency.

  Parameters:
    `vulnerability` - a vulnerability outlining a vulnerability.

### getRelatedDependencies

    public Set<Dependency> getRelatedDependencies()

  Get the value of relatedDependencies.

  Returns:
    the value of relatedDependencies

### setRelatedDependencies

    public void setRelatedDependencies(Set<Dependency> relatedDependencies)

  Set the value of relatedDependencies.

  Parameters:
    `relatedDependencies` - new value of relatedDependencies

### addRelatedDependency

    public void addRelatedDependency(Dependency dependency)

  Adds a related dependency.

  Parameters:
    `dependency` - a reference to the related dependency

### compareTo

    public int compareTo(Dependency o)

  Implementation of the Comparable interface. The comparison is solely based on the file name.

  Specified by:
    `compareTo` in interface `Comparable<Dependency>`
  Parameters:
    `o` - a dependency to compare
  Returns:
    an integer representing the natural ordering

### equals

    public boolean equals(Object obj)

  Implementation of the equals method.

  Overrides:
    `equals` in class `Object`
  Parameters:
    `obj` - the object to compare
  Returns:
    true if the objects are equal, otherwise false

### hashCode

    public int hashCode()

  Generates the HashCode.

  Overrides:
    `hashCode` in class `Object`
  Returns:
    the HashCode

### toString

    public String toString()

  Standard toString() implementation showing the filename, actualFilePath, and filePath.

  Overrides:
    `toString` in class `Object`
  Returns:
    the string representation of the file

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2012-2013 OWASP. All Rights Reserved.