You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ol...@apache.org on 2016/05/01 12:56:16 UTC

[14/50] [abbrv] maven-aether git commit: Bug 436288 - Add overload to DefaultMirrorSelector.add() that accepts already splitted ids/types

Bug 436288 - Add overload to DefaultMirrorSelector.add() that accepts already splitted ids/types

Introduced add(String, String, String, boolean, Collection<String>, Collection<String>) to DefaultMirrorSelector


Project: http://git-wip-us.apache.org/repos/asf/maven-aether/repo
Commit: http://git-wip-us.apache.org/repos/asf/maven-aether/commit/c9aeca7c
Tree: http://git-wip-us.apache.org/repos/asf/maven-aether/tree/c9aeca7c
Diff: http://git-wip-us.apache.org/repos/asf/maven-aether/diff/c9aeca7c

Branch: refs/heads/master
Commit: c9aeca7c2ff344e036e5f1c88f2f499bda98d667
Parents: db2202c
Author: Benjamin Bentmann <be...@sonatype.com>
Authored: Sat May 31 16:58:19 2014 +0200
Committer: Benjamin Bentmann <be...@sonatype.com>
Committed: Sat May 31 16:58:19 2014 +0200

----------------------------------------------------------------------
 .../util/repository/DefaultMirrorSelector.java  | 24 +++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/maven-aether/blob/c9aeca7c/aether-util/src/main/java/org/eclipse/aether/util/repository/DefaultMirrorSelector.java
----------------------------------------------------------------------
diff --git a/aether-util/src/main/java/org/eclipse/aether/util/repository/DefaultMirrorSelector.java b/aether-util/src/main/java/org/eclipse/aether/util/repository/DefaultMirrorSelector.java
index 168ff52..b5ad2b2 100644
--- a/aether-util/src/main/java/org/eclipse/aether/util/repository/DefaultMirrorSelector.java
+++ b/aether-util/src/main/java/org/eclipse/aether/util/repository/DefaultMirrorSelector.java
@@ -51,7 +51,29 @@ public final class DefaultMirrorSelector
     public DefaultMirrorSelector add( String id, String url, String type, boolean repositoryManager,
                                       String mirrorOfIds, String mirrorOfTypes )
     {
-        mirrors.add( new MirrorDef( id, url, type, repositoryManager, split( mirrorOfIds ), split( mirrorOfTypes ) ) );
+        return add( id, url, type, repositoryManager, split( mirrorOfIds ), split( mirrorOfTypes ) );
+    }
+
+    /**
+     * Adds the specified mirror to this selector.
+     * 
+     * @param id The identifier of the mirror, may be {@code null}.
+     * @param url The URL of the mirror, may be {@code null}.
+     * @param type The content type of the mirror, may be {@code null}.
+     * @param repositoryManager A flag whether the mirror is a repository manager or a simple server.
+     * @param mirrorOfIds The identifier(s) of remote repositories to mirror, may be {@code null}. The wildcards "*" and
+     *            "external:*" can be used to match all (external) repositories, prefixing a repo id with an exclamation
+     *            mark allows to express an exclusion. For example "external:*", "!central".
+     * @param mirrorOfTypes The content type(s) of remote repositories to mirror, may be {@code null} or empty to match
+     *            any content type. The wildcard "*" and the "!" negation syntax are also supported. For example "*",
+     *            "!p2".
+     * @return This selector for chaining, never {@code null}.
+     * @since 1.1.0
+     */
+    public DefaultMirrorSelector add( String id, String url, String type, boolean repositoryManager,
+                                      Collection<String> mirrorOfIds, Collection<String> mirrorOfTypes )
+    {
+        mirrors.add( new MirrorDef( id, url, type, repositoryManager, mirrorOfIds, mirrorOfTypes ) );
 
         return this;
     }