Class NexusV2Search

java.lang.Object
org.owasp.dependencycheck.data.nexus.NexusV2Search
All Implemented Interfaces:
NexusSearch

@ThreadSafe public class NexusV2Search extends Object implements NexusSearch
Class of methods to search Nexus repositories.
Author:
colezlaw
  • Constructor Details

    • NexusV2Search

      public NexusV2Search(Settings settings, boolean useProxy) throws MalformedURLException
      Creates a NexusSearch for the given repository URL.
      Parameters:
      settings - the configured settings
      useProxy - flag indicating if the proxy settings should be used
      Throws:
      MalformedURLException - thrown if the configured URL is invalid
  • Method Details

    • searchSha1

      public MavenArtifact searchSha1(String sha1) throws IOException
      Description copied from interface: NexusSearch
      Searches the configured Nexus repository for the given sha1 hash. If the artifact is found, a MavenArtifact is populated with the coordinate information.
      Specified by:
      searchSha1 in interface NexusSearch
      Parameters:
      sha1 - The SHA-1 hash string for which to search
      Returns:
      the populated Maven coordinates
      Throws:
      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 interface NexusSearch
      Returns:
      whether the repository is listening and returns the expected status response