org.apache.archiva.repository
Interface RemoteRepositoryContent

All Known Implementing Classes:
RemoteDefaultRepositoryContent, RemoteLegacyRepositoryContent

public interface RemoteRepositoryContent

RemoteRepositoryContent interface for interacting with a remote repository in an abstract way, without the need for processing based on URLs, or working with the database.


Method Summary
 String getId()
           Convenience method to get the repository id.
 RemoteRepository getRepository()
          Get the repository configuration associated with this repository content.
 RepositoryURL getURL()
           Convenience method to get the repository url.
 void setRepository(RemoteRepository repo)
          Set the repository configuration to associate with this repository content.
 ArtifactReference toArtifactReference(String path)
          Given a repository relative path to a filename, return the VersionedReference object suitable for the path.
 String toPath(ArtifactReference reference)
          Given an ArtifactReference, return the relative path to the artifact.
 RepositoryURL toURL(ArtifactReference reference)
          Given an ArtifactReference, return the url to the artifact.
 

Method Detail

getId

String getId()

Convenience method to get the repository id.

Equivalent to calling .getRepository().getId()

Returns:
the repository id.

getRepository

RemoteRepository getRepository()
Get the repository configuration associated with this repository content.

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

getURL

RepositoryURL getURL()

Convenience method to get the repository url.

Equivalent to calling new RepositoryURL( this.getRepository().getUrl() )

Returns:
the repository url.

setRepository

void setRepository(RemoteRepository repo)
Set the repository configuration to associate with this repository content.

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

toArtifactReference

ArtifactReference toArtifactReference(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.

toPath

String toPath(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.

toURL

RepositoryURL toURL(ArtifactReference reference)
Given an ArtifactReference, return the url to the artifact.

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


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