This project has retired. For details please refer to its Attic page.
ManagedRepositoryContent

org.apache.maven.archiva.repository
Interface ManagedRepositoryContent

Package class diagram package ManagedRepositoryContent
All Known Implementing Classes:
ManagedDefaultRepositoryContent, ManagedLegacyRepositoryContent

public interface ManagedRepositoryContent

ManagedRepositoryContent interface for interacting with a managed repository in an abstract way, without the need for processing based on filesystem paths, or working with the database.


Method Summary
 void deleteVersion(org.apache.maven.archiva.model.VersionedReference reference)
          Delete from the managed repository all files / directories associated with the provided version reference.
 java.lang.String getId()
           Convenience method to get the repository id.
 java.util.Set<org.apache.maven.archiva.model.ArtifactReference> getRelatedArtifacts(org.apache.maven.archiva.model.ArtifactReference reference)
           Gather up the list of related artifacts to the ArtifactReference provided.
 java.lang.String getRepoRoot()
           Convenience method to get the repository (on disk) root directory.
 org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration getRepository()
          Get the repository configuration associated with this repository content.
 java.util.Set<java.lang.String> getVersions(org.apache.maven.archiva.model.ProjectReference reference)
          Given a specific ProjectReference, return the list of available versions for that project reference.
 java.util.Set<java.lang.String> getVersions(org.apache.maven.archiva.model.VersionedReference reference)
           Given a specific VersionedReference, return the list of available versions for that versioned reference.
 boolean hasContent(org.apache.maven.archiva.model.ArtifactReference reference)
          Determines if the artifact referenced exists in the repository.
 boolean hasContent(org.apache.maven.archiva.model.ProjectReference reference)
          Determines if the project referenced exists in the repository.
 boolean hasContent(org.apache.maven.archiva.model.VersionedReference reference)
          Determines if the version reference exists in the repository.
 void setRepository(org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration repo)
          Set the repository configuration to associate with this repository content.
 org.apache.maven.archiva.model.ArtifactReference toArtifactReference(java.lang.String path)
          Given a repository relative path to a filename, return the VersionedReference object suitable for the path.
 java.io.File toFile(ArchivaArtifact reference)
          Given an ArchivaArtifact, return the file reference to the artifact.
 java.io.File toFile(org.apache.maven.archiva.model.ArtifactReference reference)
          Given an ArtifactReference, return the file reference to the artifact.
 java.lang.String toMetadataPath(org.apache.maven.archiva.model.ProjectReference reference)
          Given a ProjectReference, return the path to the metadata for the project.
 java.lang.String toMetadataPath(org.apache.maven.archiva.model.VersionedReference reference)
          Given a VersionedReference, return the path to the metadata for the specific version of the project.
 java.lang.String toPath(ArchivaArtifact reference)
          Given an ArchivaArtifact, return the relative path to the artifact.
 java.lang.String toPath(org.apache.maven.archiva.model.ArtifactReference reference)
          Given an ArtifactReference, return the relative path to the artifact.
 

Method Detail

deleteVersion

void deleteVersion(org.apache.maven.archiva.model.VersionedReference reference)
                   throws ContentNotFoundException
Delete from the managed repository all files / directories associated with the provided version reference.

Parameters:
reference - the version reference to delete.
Throws:
ContentNotFoundException

getId

java.lang.String getId()

Convenience method to get the repository id.

Equivalent to calling .getRepository().getId()

Returns:
the repository id.

getRelatedArtifacts

java.util.Set<org.apache.maven.archiva.model.ArtifactReference> getRelatedArtifacts(org.apache.maven.archiva.model.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.

Parameters:
reference - the reference to work off of.
Returns:
the set of ArtifactReferences for related artifacts.
Throws:
ContentNotFoundException - if the initial artifact reference does not exist within the repository.
LayoutException

getRepoRoot

java.lang.String getRepoRoot()

Convenience method to get the repository (on disk) root directory.

Equivalent to calling .getRepository().getLocation()

Returns:
the repository (on disk) root directory.

getRepository

org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration getRepository()
Get the repository configuration associated with this repository content.

Returns:
the repository that is associated with this repository content.

getVersions

java.util.Set<java.lang.String> getVersions(org.apache.maven.archiva.model.ProjectReference reference)
                                            throws ContentNotFoundException,
                                                   LayoutException
Given a specific ProjectReference, return the list of available versions for that project reference.

Parameters:
reference - the project reference to work off of.
Returns:
the list of versions found for that project reference.
Throws:
ContentNotFoundException - if the project reference does nto exist within the repository.
LayoutException

getVersions

java.util.Set<java.lang.String> getVersions(org.apache.maven.archiva.model.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.

Parameters:
reference - the versioned reference to work off of.
Returns:
the set of versions found.
Throws:
ContentNotFoundException - if the versioned reference does not exist within the repository.
LayoutException

hasContent

boolean hasContent(org.apache.maven.archiva.model.ArtifactReference reference)
Determines if the artifact referenced exists in the repository.

Parameters:
reference - the artifact reference to check for.
Returns:
true if the artifact referenced exists.

hasContent

boolean hasContent(org.apache.maven.archiva.model.ProjectReference reference)
Determines if the project referenced exists in the repository.

Parameters:
reference - the project reference to check for.
Returns:
true it the project referenced exists.

hasContent

boolean hasContent(org.apache.maven.archiva.model.VersionedReference reference)
Determines if the version reference exists in the repository.

Parameters:
reference - the version reference to check for.
Returns:
true if the version referenced exists.

setRepository

void setRepository(org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration repo)
Set the repository configuration to associate with this repository content.

Parameters:
repo - the repository to associate with this repository content.

toArtifactReference

org.apache.maven.archiva.model.ArtifactReference toArtifactReference(java.lang.String path)
                                                                     throws LayoutException
Given a repository relative path to a filename, return the VersionedReference object suitable for the path.

Parameters:
path - the path relative to the repository base dir for the artifact.
Returns:
the ArtifactReference representing the path. (or null if path cannot be converted to a ArtifactReference)
Throws:
LayoutException - if there was a problem converting the path to an artifact.

toFile

java.io.File toFile(org.apache.maven.archiva.model.ArtifactReference reference)
Given an ArtifactReference, return the file reference to the artifact.

Parameters:
reference - the artifact reference to use.
Returns:
the relative path to the artifact.

toFile

java.io.File toFile(ArchivaArtifact reference)
Given an ArchivaArtifact, return the file reference to the artifact.

Parameters:
reference - the archiva artifact to use.
Returns:
the relative path to the artifact.

toMetadataPath

java.lang.String toMetadataPath(org.apache.maven.archiva.model.ProjectReference reference)
Given a ProjectReference, return the path to the metadata for the project.

Parameters:
reference - the reference to use.
Returns:
the path to the metadata file, or null if no metadata is appropriate.

toMetadataPath

java.lang.String toMetadataPath(org.apache.maven.archiva.model.VersionedReference reference)
Given a VersionedReference, return the path to the metadata for the specific version of the project.

Parameters:
reference - the reference to use.
Returns:
the path to the metadata file, or null if no metadata is appropriate.

toPath

java.lang.String toPath(org.apache.maven.archiva.model.ArtifactReference reference)
Given an ArtifactReference, return the relative path to the artifact.

Parameters:
reference - the artifact reference to use.
Returns:
the relative path to the artifact.

toPath

java.lang.String toPath(ArchivaArtifact reference)
Given an ArchivaArtifact, return the relative path to the artifact.

Parameters:
reference - the archiva artifact to use.
Returns:
the relative path to the artifact.