org.apache.continuum.purge.repository.content
Interface RepositoryManagedContent

All Known Implementing Classes:
ManagedDefaultRepositoryContent, ManagedLegacyRepositoryContent

public interface RepositoryManagedContent

Taken from Archiva's ManagedRepositoryContent interface and made some few changes.

Since:
25 jul 07
Version:
$Id: RepositoryManagedContent.java 1372260 2012-08-13 04:29:09Z brett $
Author:
Maria Catherine Tan

Method Summary
 void deleteVersion(org.apache.maven.archiva.model.VersionedReference reference)
          Delete from the local repository all files / directories associated with the provided version reference.
 int getId()
           Convenience method to get the repository id.
 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.
 String getRepoRoot()
           Convenience method to get the repository (on disk) root directory.
 LocalRepository getRepository()
          Get the local repository associated with this repository content.
 Set<String> getVersions(org.apache.maven.archiva.model.ProjectReference reference)
          Given a specific ProjectReference, return the list of available versions for that project reference.
 Set<String> getVersions(org.apache.maven.archiva.model.VersionedReference reference)
           Given a specific VersionedReference, return the list of available versions for that versioned reference.
 void setRepository(LocalRepository repo)
          Set the local repository to associate with this repository content.
 org.apache.maven.archiva.model.ArtifactReference toArtifactReference(String path)
          Given a repository relative path to a filename, return the VersionedReference object suitable for the path.
 File toFile(org.apache.maven.archiva.model.ArtifactReference reference)
          Given an ArtifactReference, return the file reference to the artifact.
 String toMetadataPath(org.apache.maven.archiva.model.ProjectReference reference)
          Given a ProjectReference, return the path to the metadata for the project.
 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.
 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 org.apache.maven.archiva.repository.ContentNotFoundException
Delete from the local repository all files / directories associated with the provided version reference.

Parameters:
reference - the version reference to delete.
Throws:
org.apache.maven.archiva.repository.ContentNotFoundException

getId

int getId()

Convenience method to get the repository id.

Equivalent to calling .getRepository().getId()

Returns:
the repository id.

getRelatedArtifacts

Set<org.apache.maven.archiva.model.ArtifactReference> getRelatedArtifacts(org.apache.maven.archiva.model.ArtifactReference reference)
                                                                          throws org.apache.maven.archiva.repository.ContentNotFoundException,
                                                                                 org.apache.maven.archiva.repository.layout.LayoutException

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:
org.apache.maven.archiva.repository.ContentNotFoundException - if the initial artifact reference does not exist within the repository.
org.apache.maven.archiva.repository.layout.LayoutException

getRepoRoot

String getRepoRoot()

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

Equivalent to calling .getLocalRepository().getDirectory()

Returns:
the repository (on disk) root directory.

getRepository

LocalRepository getRepository()
Get the local repository associated with this repository content.

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

getVersions

Set<String> getVersions(org.apache.maven.archiva.model.ProjectReference reference)
                        throws org.apache.maven.archiva.repository.ContentNotFoundException,
                               org.apache.maven.archiva.repository.layout.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:
org.apache.maven.archiva.repository.ContentNotFoundException - if the project reference does not exist within the repository.
org.apache.maven.archiva.repository.layout.LayoutException

getVersions

Set<String> getVersions(org.apache.maven.archiva.model.VersionedReference reference)
                        throws org.apache.maven.archiva.repository.ContentNotFoundException,
                               org.apache.maven.archiva.repository.layout.LayoutException

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:
org.apache.maven.archiva.repository.ContentNotFoundException - if the versioned reference does not exist within the repository.
org.apache.maven.archiva.repository.layout.LayoutException

setRepository

void setRepository(LocalRepository repo)
Set the local repository to associate with this repository content.

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

toArtifactReference

org.apache.maven.archiva.model.ArtifactReference toArtifactReference(String path)
                                                                     throws org.apache.maven.archiva.repository.layout.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:
org.apache.maven.archiva.repository.layout.LayoutException - if there was a problem converting the path to an artifact.

toFile

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.

toMetadataPath

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

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

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.


Copyright © 2003-2013 The Apache Software Foundation. All Rights Reserved.