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

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

public class ManagedDefaultRepositoryContent
extends Object
implements RepositoryManagedContent

Taken from Archiva's ManagedDefaultRepositoryContent and made some few changes.


Constructor Summary
ManagedDefaultRepositoryContent()
           
 
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)
          Gather the Available Versions (on disk) for a specific Project Reference, based on filesystem information.
 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 repository)
          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

ManagedDefaultRepositoryContent

public ManagedDefaultRepositoryContent()
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,
                               org.apache.maven.archiva.repository.layout.LayoutException
Gather the Available Versions (on disk) for a specific Project Reference, based on filesystem information.

Specified by:
getVersions in interface RepositoryManagedContent
Parameters:
reference - the project reference to work off of.
Returns:
the Set of available versions, based on the project reference.
Throws:
org.apache.maven.archiva.repository.ContentNotFoundException
org.apache.maven.archiva.repository.layout.LayoutException

getVersions

public Set<String> getVersions(org.apache.maven.archiva.model.VersionedReference reference)
                        throws org.apache.maven.archiva.repository.ContentNotFoundException,
                               org.apache.maven.archiva.repository.layout.LayoutException
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.
org.apache.maven.archiva.repository.layout.LayoutException

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 repository)
Description copied from interface: RepositoryManagedContent
Set the local repository to associate with this repository content.

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

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.


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