Class NexusV3Search

  • All Implemented Interfaces:
    NexusSearch

    @ThreadSafe
    public class NexusV3Search
    extends java.lang.Object
    implements NexusSearch
    Class of methods to search Nexus v3 repositories.
    Author:
    Hans Aikema
    • Constructor Summary

      Constructors 
      Constructor Description
      NexusV3Search​(Settings settings, boolean useProxy)
      Creates a NexusV3Search 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • NexusV3Search

        public NexusV3Search​(Settings settings,
                             boolean useProxy)
                      throws java.net.MalformedURLException
        Creates a NexusV3Search for the given repository URL.
        Parameters:
        settings - the configured settings
        useProxy - 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, 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:
        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 interface NexusSearch
        Returns:
        whether the repository is listening and returns the expected status response