Class CentralSearch
java.lang.Object
org.owasp.dependencycheck.data.central.CentralSearch
Class of methods to search Maven Central via Central.
- Author:
- colezlaw
-
Constructor Summary
ConstructorsConstructorDescriptionCentralSearch(Settings settings) Creates a NexusSearch for the given repository URL. -
Method Summary
Modifier and TypeMethodDescriptionsearchSha1(String sha1) Searches the configured Central URL for the given SHA1 hash.
-
Constructor Details
-
CentralSearch
Creates a NexusSearch for the given repository URL.- Parameters:
settings- the configured settings- Throws:
MalformedURLException- thrown if the configured URL is invalid
-
-
Method Details
-
searchSha1
public List<MavenArtifact> searchSha1(String sha1) throws IOException, TooManyRequestsException, ForbiddenException Searches the configured Central URL for the given SHA1 hash. If the artifact is found, aMavenArtifactis populated with the GAV.- Parameters:
sha1- the SHA-1 hash string for which to search- Returns:
- the populated Maven GAV.
- Throws:
FileNotFoundException- if the specified artifact is not foundIOException- if it's unable to connect to the specified repositoryTooManyRequestsException- if Central has received too many requests.ForbiddenException
-