public interface ManagedRepositoryContent
Modifier and Type | Method and Description |
---|---|
void |
deleteArtifact(ArtifactReference artifactReference)
delete a specified artifact from the repository
|
void |
deleteGroupId(String groupId) |
void |
deleteProject(String namespace,
String projectId) |
void |
deleteVersion(VersionedReference reference)
Delete from the managed repository all files / directories associated with the
provided version reference.
|
String |
getId()
Convenience method to get the repository id.
|
Set<ArtifactReference> |
getRelatedArtifacts(ArtifactReference reference)
Gather up the list of related artifacts to the ArtifactReference provided.
|
String |
getRepoRoot()
Convenience method to get the repository (on disk) root directory.
|
ManagedRepository |
getRepository()
Get the repository configuration associated with this
repository content.
|
Set<String> |
getVersions(ProjectReference reference)
Given a specific
ProjectReference , return the list of available versions for
that project reference. |
Set<String> |
getVersions(VersionedReference reference)
Given a specific
VersionedReference , return the list of available versions for that
versioned reference. |
boolean |
hasContent(ArtifactReference reference)
Determines if the artifact referenced exists in the repository.
|
boolean |
hasContent(ProjectReference reference)
Determines if the project referenced exists in the repository.
|
boolean |
hasContent(VersionedReference reference)
Determines if the version reference exists in the repository.
|
void |
setRepository(ManagedRepository repo)
Set the repository configuration to associate with this
repository content.
|
ArtifactReference |
toArtifactReference(String path)
Given a repository relative path to a filename, return the
VersionedReference object suitable for the path. |
File |
toFile(ArchivaArtifact reference)
Given an
ArchivaArtifact , return the file reference to the artifact. |
File |
toFile(ArtifactReference reference)
Given an
ArtifactReference , return the file reference to the artifact. |
String |
toMetadataPath(ProjectReference reference)
Given a
ProjectReference , return the path to the metadata for
the project. |
String |
toMetadataPath(VersionedReference reference)
Given a
VersionedReference , return the path to the metadata for
the specific version of the project. |
String |
toPath(ArchivaArtifact reference)
Given an
ArchivaArtifact , return the relative path to the artifact. |
String |
toPath(ArtifactReference reference)
Given an
ArtifactReference , return the relative path to the artifact. |
void deleteVersion(VersionedReference reference) throws ContentNotFoundException
reference
- the version reference to delete.ContentNotFoundException
void deleteArtifact(ArtifactReference artifactReference) throws ContentNotFoundException
artifactReference
- ContentNotFoundException
void deleteGroupId(String groupId) throws ContentNotFoundException
groupId
- ContentNotFoundException
void deleteProject(String namespace, String projectId) throws RepositoryException
namespace
- groupId for mavenprojectId
- artifactId for mavenContentNotFoundException
RepositoryException
String getId()
Convenience method to get the repository id.
Equivalent to calling .getRepository().getId()
Set<ArtifactReference> getRelatedArtifacts(ArtifactReference reference) throws ContentNotFoundException
Gather up the list of related artifacts to the ArtifactReference provided. This typically inclues the pom files, and those things with classifiers (such as doc, source code, test libs, etc...)
NOTE: Some layouts (such as maven 1 "legacy") are not compatible with this query.
reference
- the reference to work off of.ContentNotFoundException
- if the initial artifact reference does not exist within the repository.String getRepoRoot()
Convenience method to get the repository (on disk) root directory.
Equivalent to calling .getRepository().getLocation()
ManagedRepository getRepository()
Set<String> getVersions(ProjectReference reference) throws ContentNotFoundException, LayoutException
ProjectReference
, return the list of available versions for
that project reference.reference
- the project reference to work off of.ContentNotFoundException
- if the project reference does nto exist within the repository.LayoutException
Set<String> getVersions(VersionedReference reference) throws ContentNotFoundException
Given a specific VersionedReference
, return the list of available versions for that
versioned reference.
NOTE: This is really only useful when working with SNAPSHOTs.
reference
- the versioned reference to work off of.ContentNotFoundException
- if the versioned reference does not exist within the repository.boolean hasContent(ArtifactReference reference)
reference
- the artifact reference to check for.boolean hasContent(ProjectReference reference)
reference
- the project reference to check for.boolean hasContent(VersionedReference reference)
reference
- the version reference to check for.void setRepository(ManagedRepository repo)
repo
- the repository to associate with this repository content.ArtifactReference toArtifactReference(String path) throws LayoutException
VersionedReference
object suitable for the path.path
- the path relative to the repository base dir for the artifact.ArtifactReference
representing the path. (or null if path cannot be converted to
a ArtifactReference
)LayoutException
- if there was a problem converting the path to an artifact.File toFile(ArtifactReference reference)
ArtifactReference
, return the file reference to the artifact.reference
- the artifact reference to use.File toFile(ArchivaArtifact reference)
ArchivaArtifact
, return the file reference to the artifact.reference
- the archiva artifact to use.String toMetadataPath(ProjectReference reference)
ProjectReference
, return the path to the metadata for
the project.reference
- the reference to use.String toMetadataPath(VersionedReference reference)
VersionedReference
, return the path to the metadata for
the specific version of the project.reference
- the reference to use.String toPath(ArtifactReference reference)
ArtifactReference
, return the relative path to the artifact.reference
- the artifact reference to use.String toPath(ArchivaArtifact reference)
ArchivaArtifact
, return the relative path to the artifact.reference
- the archiva artifact to use.Copyright © 2006–2022 The Apache Software Foundation. All rights reserved.