public class ManagedDefaultRepositoryContent extends AbstractDefaultRepositoryContent implements ManagedRepositoryContent
ARTIFACT_SEPARATOR, artifactMappingProviders, GROUP_SEPARATOR, log, MAVEN_METADATA, PATH_SEPARATOR
Constructor and Description |
---|
ManagedDefaultRepositoryContent(ManagedRepository repository,
FileTypes fileTypes,
FileLockManager lockManager) |
ManagedDefaultRepositoryContent(ManagedRepository repository,
List<? extends ArtifactMappingProvider> artifactMappingProviders,
FileTypes fileTypes,
FileLockManager lockManager) |
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)
Gather the Available Versions (on disk) for a specific Project Reference, based on filesystem
information.
|
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 |
setFiletypes(FileTypes filetypes) |
void |
setFileTypes(FileTypes fileTypes) |
void |
setRepository(ManagedRepository repo)
Set the repository configuration to associate with this
repository content.
|
ArtifactReference |
toArtifactReference(String path)
Convert a path to an artifact reference.
|
StorageAsset |
toFile(ArchivaArtifact reference)
Given an
ArchivaArtifact , return the file reference to the artifact. |
StorageAsset |
toFile(ArtifactReference reference)
Given an
ArtifactReference , return the file reference to the artifact. |
setArtifactMappingProviders, toMetadataPath, toMetadataPath, toPath, toPath
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
toMetadataPath, toMetadataPath, toPath
toPath
public ManagedDefaultRepositoryContent(ManagedRepository repository, FileTypes fileTypes, FileLockManager lockManager)
public ManagedDefaultRepositoryContent(ManagedRepository repository, List<? extends ArtifactMappingProvider> artifactMappingProviders, FileTypes fileTypes, FileLockManager lockManager)
public void setFileTypes(FileTypes fileTypes)
public void deleteVersion(VersionedReference reference)
ManagedRepositoryContent
deleteVersion
in interface ManagedRepositoryContent
reference
- the version reference to delete.public void deleteProject(String namespace, String projectId) throws RepositoryException
deleteProject
in interface ManagedRepositoryContent
namespace
- groupId for mavenprojectId
- artifactId for mavenContentNotFoundException
RepositoryException
public void deleteArtifact(ArtifactReference artifactReference)
ManagedRepositoryContent
deleteArtifact
in interface ManagedRepositoryContent
public void deleteGroupId(String groupId) throws ContentNotFoundException
deleteGroupId
in interface ManagedRepositoryContent
ContentNotFoundException
public String getId()
ManagedRepositoryContent
Convenience method to get the repository id.
Equivalent to calling .getRepository().getId()
getId
in interface ManagedRepositoryContent
public Set<ArtifactReference> getRelatedArtifacts(ArtifactReference reference) throws ContentNotFoundException
ManagedRepositoryContent
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.
getRelatedArtifacts
in interface ManagedRepositoryContent
reference
- the reference to work off of.ContentNotFoundException
- if the initial artifact reference does not exist within the repository.public String getRepoRoot()
ManagedRepositoryContent
Convenience method to get the repository (on disk) root directory.
Equivalent to calling .getRepository().getLocation()
getRepoRoot
in interface ManagedRepositoryContent
public ManagedRepository getRepository()
ManagedRepositoryContent
getRepository
in interface ManagedRepositoryContent
public Set<String> getVersions(ProjectReference reference) throws ContentNotFoundException, LayoutException
getVersions
in interface ManagedRepositoryContent
reference
- the project reference to work off of.LayoutException
ContentNotFoundException
- if the project reference does nto exist within the repository.public Set<String> getVersions(VersionedReference reference) throws ContentNotFoundException
ManagedRepositoryContent
Given a specific VersionedReference
, return the list of available versions for that
versioned reference.
NOTE: This is really only useful when working with SNAPSHOTs.
getVersions
in interface ManagedRepositoryContent
reference
- the versioned reference to work off of.ContentNotFoundException
- if the versioned reference does not exist within the repository.public boolean hasContent(ArtifactReference reference)
ManagedRepositoryContent
hasContent
in interface ManagedRepositoryContent
reference
- the artifact reference to check for.public boolean hasContent(ProjectReference reference)
ManagedRepositoryContent
hasContent
in interface ManagedRepositoryContent
reference
- the project reference to check for.public boolean hasContent(VersionedReference reference)
ManagedRepositoryContent
hasContent
in interface ManagedRepositoryContent
reference
- the version reference to check for.public void setRepository(ManagedRepository repo)
ManagedRepositoryContent
setRepository
in interface ManagedRepositoryContent
repo
- the repository to associate with this repository content.public ArtifactReference toArtifactReference(String path) throws LayoutException
toArtifactReference
in interface RepositoryContent
toArtifactReference
in class AbstractDefaultRepositoryContent
path
- the path to convert. (relative or full location path)ArtifactReference
representing the path. (or null if path cannot be converted to
a ArtifactReference
)LayoutException
- if the path cannot be converted to an artifact reference.public StorageAsset toFile(ArtifactReference reference)
ManagedRepositoryContent
ArtifactReference
, return the file reference to the artifact.toFile
in interface ManagedRepositoryContent
reference
- the artifact reference to use.public StorageAsset toFile(ArchivaArtifact reference)
ManagedRepositoryContent
ArchivaArtifact
, return the file reference to the artifact.toFile
in interface ManagedRepositoryContent
reference
- the archiva artifact to use.public void setFiletypes(FileTypes filetypes)
Copyright © 2006–2019 The Apache Software Foundation. All rights reserved.