Class ArchivaConnector
java.lang.Object
zleurtor.scanmanager.model.update.ArchivaConnector
- All Implemented Interfaces:
AutoCloseable
,ArtifactRepositoryManagerConnector
The connector for the Archiva artifact repository manager.
- Author:
- Zleurtor
-
Constructor Summary
ConstructorsConstructorDescriptionArchivaConnector
(String theArchivaUrl) Constructs a new artifact repository manager connector for the specified URL. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a new artifact repository manager connector listener.void
close()
void
Download the content of the specified URL to the given file.int
searchArtifactSize
(String groupId, String artifactId, String version, String classifier, String packaging) Searches the size of the artifact having the specified groupId, artifactId, version and classifier.searchArtifactUrl
(String groupId, String artifactId, String version, String classifier, String packaging) Searches the URL for accessing to the artifact having the specified groupId, artifactId, version and classifier.searchLatestVersion
(String groupId, String artifactId) Searches (and returns) the latest release version for the specified groupId and artifactId.
-
Constructor Details
-
ArchivaConnector
public ArchivaConnector(String theArchivaUrl) throws KeyManagementException, NoSuchAlgorithmException, KeyStoreException Constructs a new artifact repository manager connector for the specified URL.- Parameters:
theArchivaUrl
- The URL to the Archiva repository manager.- Throws:
KeyStoreException
- If the TrustStrategy fails to load.NoSuchAlgorithmException
- If no Provider supports aTrustManagerFactorySpi implementation for the "trust all" strategy.KeyManagementException
- If the SSL context builder fails to initialize.
-
-
Method Details
-
searchLatestVersion
Description copied from interface:ArtifactRepositoryManagerConnector
Searches (and returns) the latest release version for the specified groupId and artifactId.- Specified by:
searchLatestVersion
in interfaceArtifactRepositoryManagerConnector
- 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
public URL searchArtifactUrl(String groupId, String artifactId, String version, String classifier, String packaging) throws MalformedURLException Description copied from interface:ArtifactRepositoryManagerConnector
Searches the URL for accessing to the artifact having the specified groupId, artifactId, version and classifier.- Specified by:
searchArtifactUrl
in interfaceArtifactRepositoryManagerConnector
- 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
public int searchArtifactSize(String groupId, String artifactId, String version, String classifier, String packaging) throws MalformedURLException Description copied from interface:ArtifactRepositoryManagerConnector
Searches the size of the artifact having the specified groupId, artifactId, version and classifier.- Specified by:
searchArtifactSize
in interfaceArtifactRepositoryManagerConnector
- 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
Description copied from interface:ArtifactRepositoryManagerConnector
Download the content of the specified URL to the given file.- Specified by:
download
in interfaceArtifactRepositoryManagerConnector
- 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
- Specified by:
close
in interfaceArtifactRepositoryManagerConnector
- Specified by:
close
in interfaceAutoCloseable
- Throws:
IOException
-
addArtifactRepositoryManagerConnectorListener
public void addArtifactRepositoryManagerConnectorListener(ArtifactRepositoryManagerConnectorListener listener) Description copied from interface:ArtifactRepositoryManagerConnector
Add a new artifact repository manager connector listener.- Specified by:
addArtifactRepositoryManagerConnectorListener
in interfaceArtifactRepositoryManagerConnector
- Parameters:
listener
- The new artifact repository manager connector listener.
-