Class NexusV2Search
- java.lang.Object
-
- org.owasp.dependencycheck.data.nexus.NexusV2Search
-
- All Implemented Interfaces:
NexusSearch
@ThreadSafe public class NexusV2Search extends java.lang.Object implements NexusSearch
Class of methods to search Nexus repositories.- Author:
- colezlaw
-
-
Constructor Summary
Constructors Constructor Description NexusV2Search(Settings settings, boolean useProxy)
Creates a NexusSearch for the given repository URL.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
preflightRequest()
Do a preflight request to see if the repository is actually working.MavenArtifact
searchSha1(java.lang.String sha1)
Searches the configured Nexus repository for the given sha1 hash.
-
-
-
Constructor Detail
-
NexusV2Search
public NexusV2Search(Settings settings, boolean useProxy) throws java.net.MalformedURLException
Creates a NexusSearch for the given repository URL.- Parameters:
settings
- the configured settingsuseProxy
- flag indicating if the proxy settings should be used- Throws:
java.net.MalformedURLException
- thrown if the configured URL is invalid
-
-
Method Detail
-
searchSha1
public MavenArtifact searchSha1(java.lang.String sha1) throws java.io.IOException
Description copied from interface:NexusSearch
Searches the configured Nexus repository for the given sha1 hash. If the artifact is found, aMavenArtifact
is populated with the coordinate information.- Specified by:
searchSha1
in interfaceNexusSearch
- Parameters:
sha1
- The SHA-1 hash string for which to search- Returns:
- the populated Maven coordinates
- Throws:
java.io.IOException
- if it's unable to connect to the specified repository or if the specified artifact is not found.
-
preflightRequest
public boolean preflightRequest()
Description copied from interface:NexusSearch
Do a preflight request to see if the repository is actually working.- Specified by:
preflightRequest
in interfaceNexusSearch
- Returns:
- whether the repository is listening and returns the expected status response
-
-