org.owasp.dependencycheck.data.artifactory.ItemImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of dependency-check-core Show documentation
Show all versions of dependency-check-core Show documentation
dependency-check-core is the engine and reporting tool used to identify and report if there are any known, publicly disclosed vulnerabilities in the scanned project's dependencies. The engine extracts meta-data from the dependencies and uses this to do fuzzy key-word matching against the Common Platfrom Enumeration (CPE), if any CPE identifiers are found the associated Common Vulnerability and Exposure (CVE) entries are added to the generated report.
package org.owasp.dependencycheck.data.artifactory;
import java.io.File;
import java.util.Date;
/**
* Copied from JFrog's artifactory client.
*
* @see
* artifactory-client-java
*
* @author jbaruch
* @since 29/07/12
*/
public class ItemImpl {
private String uri;
private String repo;
private String path;
private boolean folder;
private String metadataUri;
private Date lastModified;
private String modifiedBy;
private Date lastUpdated;
protected ItemImpl(boolean folder, String uri, String metadataUri, Date lastModified, String modifiedBy, Date lastUpdated) {
this.folder = folder;
this.uri = uri;
this.metadataUri = metadataUri;
this.lastModified = lastModified;
this.modifiedBy = modifiedBy;
this.lastUpdated = lastUpdated;
}
protected ItemImpl() {
}
protected ItemImpl(boolean folder, String uri) {
this.folder = folder;
this.uri = uri;
}
public String getPath() {
return path;
}
private void setPath(String path) {
this.path = path;
}
public String getRepo() {
return repo;
}
private void setRepo(String repo) {
this.repo = repo;
}
public boolean isFolder() {
return folder;
}
private void setFolder(boolean folder) {
this.folder = folder;
}
public String getName() {
return new File(uri).getName();
}
public String getUri() {
return uri;
}
private void setUri(String uri) {
this.uri = uri;
}
public String getMetadataUri() {
return metadataUri;
}
private void setMetadataUri(String metadataUri) {
this.metadataUri = metadataUri;
}
public Date getLastModified() {
return lastModified;
}
private void setLastModified(Date lastModified) {
this.lastModified = lastModified;
}
public String getModifiedBy() {
return modifiedBy;
}
private void setModifiedBy(String modifiedBy) {
this.modifiedBy = modifiedBy;
}
public Date getLastUpdated() {
return lastUpdated;
}
private void setLastUpdated(Date lastUpdated) {
this.lastUpdated = lastUpdated;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof ItemImpl)) {
return false;
}
ItemImpl item = (ItemImpl) o;
return uri.equals(item.uri);
}
@Override
public int hashCode() {
return uri.hashCode();
}
}