Author: bentmann
Date: Wed Sep  2 17:02:06 2009
New Revision: 810613

URL: http://svn.apache.org/viewvc?rev=810613&view=rev
Log:
o Exposed getMirror() logic to public clients

Modified:
    
maven/components/trunk/maven-compat/src/main/java/org/apache/maven/repository/LegacyRepositorySystem.java
    
maven/components/trunk/maven-compat/src/main/java/org/apache/maven/repository/RepositorySystem.java

Modified: 
maven/components/trunk/maven-compat/src/main/java/org/apache/maven/repository/LegacyRepositorySystem.java
URL: 
http://svn.apache.org/viewvc/maven/components/trunk/maven-compat/src/main/java/org/apache/maven/repository/LegacyRepositorySystem.java?rev=810613&r1=810612&r2=810613&view=diff
==============================================================================
--- 
maven/components/trunk/maven-compat/src/main/java/org/apache/maven/repository/LegacyRepositorySystem.java
 (original)
+++ 
maven/components/trunk/maven-compat/src/main/java/org/apache/maven/repository/LegacyRepositorySystem.java
 Wed Sep  2 17:02:06 2009
@@ -452,11 +452,11 @@
         }
     }
 
-    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 )
             {

Modified: 
maven/components/trunk/maven-compat/src/main/java/org/apache/maven/repository/RepositorySystem.java
URL: 
http://svn.apache.org/viewvc/maven/components/trunk/maven-compat/src/main/java/org/apache/maven/repository/RepositorySystem.java?rev=810613&r1=810612&r2=810613&view=diff
==============================================================================
--- 
maven/components/trunk/maven-compat/src/main/java/org/apache/maven/repository/RepositorySystem.java
 (original)
+++ 
maven/components/trunk/maven-compat/src/main/java/org/apache/maven/repository/RepositorySystem.java
 Wed Sep  2 17:02:06 2009
@@ -93,6 +93,15 @@
     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
      * matching mirror will pass through unchanged. <em>Note:</em> This method 
must be called before


Reply via email to