org.apache.continuum.purge.repository.content
Class ManagedLegacyRepositoryContent

java.lang.Object
  extended by org.apache.continuum.purge.repository.content.ManagedLegacyRepositoryContent
All Implemented Interfaces:
RepositoryManagedContent

public class ManagedLegacyRepositoryContent
extends Object
implements RepositoryManagedContent

Taken from Archiva's ManagedLegacyRepositoryContent and made some few changes


Constructor Summary
ManagedLegacyRepositoryContent()
           
 
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)
          Convert a path to an artifact reference.
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ManagedLegacyRepositoryContent

public ManagedLegacyRepositoryContent()
Method Detail

deleteVersion

public void deleteVersion(org.apache.maven.archiva.model.VersionedReference reference)
                   throws org.apache.maven.archiva.repository.ContentNotFoundException
Description copied from interface: RepositoryManagedContent
Delete from the local repository all files / directories associated with the provided version reference.

Specified by:
deleteVersion in interface RepositoryManagedContent
Parameters:
reference - the version reference to delete.
Throws:
org.apache.maven.archiva.repository.ContentNotFoundException

getId

public int getId()
Description copied from interface: RepositoryManagedContent

Convenience method to get the repository id.

Equivalent to calling .getRepository().getId()

Specified by:
getId in interface RepositoryManagedContent
Returns:
the repository id.

getRelatedArtifacts

public 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
Description copied from interface: RepositoryManagedContent

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.

Specified by:
getRelatedArtifacts in interface RepositoryManagedContent
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

public String getRepoRoot()
Description copied from interface: RepositoryManagedContent

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

Equivalent to calling .getLocalRepository().getDirectory()

Specified by:
getRepoRoot in interface RepositoryManagedContent
Returns:
the repository (on disk) root directory.

getRepository

public LocalRepository getRepository()
Description copied from interface: RepositoryManagedContent
Get the local repository associated with this repository content.

Specified by:
getRepository in interface RepositoryManagedContent
Returns:
the local repository that is associated with this repository content.

getVersions

public Set<String> getVersions(org.apache.maven.archiva.model.ProjectReference reference)
                        throws org.apache.maven.archiva.repository.ContentNotFoundException
Description copied from interface: RepositoryManagedContent
Given a specific ProjectReference, return the list of available versions for that project reference.

Specified by:
getVersions in interface RepositoryManagedContent
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.

getVersions

public Set<String> getVersions(org.apache.maven.archiva.model.VersionedReference reference)
                        throws org.apache.maven.archiva.repository.ContentNotFoundException
Description copied from interface: RepositoryManagedContent

Given a specific VersionedReference, return the list of available versions for that versioned reference.

NOTE: This is really only useful when working with SNAPSHOTs.

Specified by:
getVersions in interface RepositoryManagedContent
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.

toArtifactReference

public org.apache.maven.archiva.model.ArtifactReference toArtifactReference(String path)
                                                                     throws org.apache.maven.archiva.repository.layout.LayoutException
Convert a path to an artifact reference.

Specified by:
toArtifactReference in interface RepositoryManagedContent
Parameters:
path - the path to convert. (relative or full location path)
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 the path cannot be converted to an artifact reference.

toFile

public File toFile(org.apache.maven.archiva.model.ArtifactReference reference)
Description copied from interface: RepositoryManagedContent
Given an ArtifactReference, return the file reference to the artifact.

Specified by:
toFile in interface RepositoryManagedContent
Parameters:
reference - the artifact reference to use.
Returns:
the relative path to the artifact.

toMetadataPath

public String toMetadataPath(org.apache.maven.archiva.model.ProjectReference reference)
Description copied from interface: RepositoryManagedContent
Given a ProjectReference, return the path to the metadata for the project.

Specified by:
toMetadataPath in interface RepositoryManagedContent
Parameters:
reference - the reference to use.
Returns:
the path to the metadata file, or null if no metadata is appropriate.

toMetadataPath

public String toMetadataPath(org.apache.maven.archiva.model.VersionedReference reference)
Description copied from interface: RepositoryManagedContent
Given a VersionedReference, return the path to the metadata for the specific version of the project.

Specified by:
toMetadataPath in interface RepositoryManagedContent
Parameters:
reference - the reference to use.
Returns:
the path to the metadata file, or null if no metadata is appropriate.

toPath

public String toPath(org.apache.maven.archiva.model.ArtifactReference reference)
Description copied from interface: RepositoryManagedContent
Given an ArtifactReference, return the relative path to the artifact.

Specified by:
toPath in interface RepositoryManagedContent
Parameters:
reference - the artifact reference to use.
Returns:
the relative path to the artifact.

setRepository

public void setRepository(LocalRepository repo)
Description copied from interface: RepositoryManagedContent
Set the local repository to associate with this repository content.

Specified by:
setRepository in interface RepositoryManagedContent
Parameters:
repo - the repository to associate with this repository content.


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