Interface ArtifactRepositoryManagerConnector

All Superinterfaces:
AutoCloseable
All Known Implementing Classes:
ArchivaConnector

public interface ArtifactRepositoryManagerConnector extends AutoCloseable
The interface which all artifact repository manager connectors shall implements.
Author:
Zleurtor
  • Method Details

    • searchLatestVersion

      String searchLatestVersion(String groupId, String artifactId)
      Searches (and returns) the latest release version for the specified groupId and artifactId.
      Parameters:
      groupId - The groupId of the artifact for which the versions are queried.
      artifactId - The artifactId of the artifact for which the versions are queried.
      Returns:
      All the latest release version for the specified groupId and artifactId.
    • searchArtifactUrl

      URL searchArtifactUrl(String groupId, String artifactId, String version, String classifier, String packaging) throws MalformedURLException
      Searches the URL for accessing to the artifact having the specified groupId, artifactId, version and classifier.
      Parameters:
      groupId - The group id of the queried artifact.
      artifactId - The artifact id of the queried artifact.
      version - The version of the queried artifact.
      classifier - The classifier of the queried artifact.
      packaging - The packaging of the queried artifact.
      Returns:
      The URL for accessing to the artifact having the specified groupId, artifactId, version and classifier.
      Throws:
      MalformedURLException - If a URL is malformed.
    • searchArtifactSize

      int searchArtifactSize(String groupId, String artifactId, String version, String classifier, String packaging) throws MalformedURLException
      Searches the size of the artifact having the specified groupId, artifactId, version and classifier.
      Parameters:
      groupId - The group id of the queried artifact.
      artifactId - The artifact id of the queried artifact.
      version - The version of the queried artifact.
      classifier - The classifier of the queried artifact.
      packaging - The packaging of the queried artifact.
      Returns:
      The URL for accessing to the artifact having the specified groupId, artifactId, version and classifier.
      Throws:
      MalformedURLException - If a URL is malformed.
    • download

      void download(URL source, int size, File dest) throws IOException, URISyntaxException
      Download the content of the specified URL to the given file.
      Parameters:
      source - The URL of which the content shall be downloaded.
      size - The size of the artifact to download.
      dest - The file to which the URL content shall be downloaded.
      Throws:
      IOException - If an input/output error occurs during download.
      URISyntaxException - If a URI is malformed.
    • close

      void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Throws:
      IOException
    • addArtifactRepositoryManagerConnectorListener

      void addArtifactRepositoryManagerConnectorListener(ArtifactRepositoryManagerConnectorListener listener)
      Add a new artifact repository manager connector listener.
      Parameters:
      listener - The new artifact repository manager connector listener.