Class CentralSearch
- java.lang.Object
-
- org.owasp.dependencycheck.data.central.CentralSearch
-
@ThreadSafe public class CentralSearch extends java.lang.Object
Class of methods to search Maven Central via Central.- Author:
- colezlaw
-
-
Constructor Summary
Constructors Constructor Description CentralSearch(Settings settings)
Creates a NexusSearch for the given repository URL.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<MavenArtifact>
searchSha1(java.lang.String sha1)
Searches the configured Central URL for the given SHA1 hash.
-
-
-
Constructor Detail
-
CentralSearch
public CentralSearch(Settings settings) throws java.net.MalformedURLException
Creates a NexusSearch for the given repository URL.- Parameters:
settings
- the configured settings- Throws:
java.net.MalformedURLException
- thrown if the configured URL is invalid
-
-
Method Detail
-
searchSha1
public java.util.List<MavenArtifact> searchSha1(java.lang.String sha1) throws java.io.IOException, TooManyRequestsException
Searches the configured Central URL for the given SHA1 hash. If the artifact is found, aMavenArtifact
is populated with the GAV.- Parameters:
sha1
- the SHA-1 hash string for which to search- Returns:
- the populated Maven GAV.
- Throws:
java.io.FileNotFoundException
- if the specified artifact is not foundjava.io.IOException
- if it's unable to connect to the specified repositoryTooManyRequestsException
- if Central has received too many requests.
-
-