o Exposed getMirror() logic to public clients

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@810613 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Benjamin Bentmann 2009-09-02 17:02:06 +00:00
parent 326e14b853
commit 07f5ea260a
2 changed files with 11 additions and 2 deletions

View File

@ -452,11 +452,11 @@ public class LegacyRepositorySystem
}
}
private Mirror getMirror( ArtifactRepository repository, List<Mirror> mirrors )
public Mirror getMirror( ArtifactRepository repository, List<Mirror> mirrors )
{
String repoId = repository.getId();
if ( repoId != null )
if ( repoId != null && mirrors != null )
{
for ( Mirror mirror : mirrors )
{

View File

@ -92,6 +92,15 @@ public interface RepositorySystem
*/
List<ArtifactRepository> getEffectiveRepositories( List<ArtifactRepository> repositories );
/**
* Determines the mirror for the specified repository.
*
* @param repository The repository to determine the mirror for, must not be {@code null}.
* @param mirrors The available mirrors, may be {@code null}.
* @return The mirror specification for the repository or {@code null} if no mirror matched.
*/
Mirror getMirror( ArtifactRepository repository, List<Mirror> mirrors );
/**
* Injects the mirroring information into the specified repositories. For each repository that is matched by a
* mirror, its URL and ID will be updated to match the values from the mirror specification. Repositories without a