Skip to content

Commit

Permalink
New getMirrors() method for getting all configured mirror locations.
Browse files Browse the repository at this point in the history
  • Loading branch information
kevloral committed Jan 7, 2024
1 parent 128740c commit b1a693f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
package org.eclipse.tycho.p2maven.repository;

import java.net.URI;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
Expand Down Expand Up @@ -158,4 +159,14 @@ public void initialize() throws InitializationException {
mirrors = Collections.emptyList();
}
}

@Override
public Iterable<MavenRepositoryLocation> getMirrors() {
List<MavenRepositoryLocation> result = new ArrayList<>();
for (Mirror mirror : mirrors) {
MavenRepositoryLocation location = new MavenRepositoryLocation(mirror.getId(), URI.create(mirror.getUrl()));
result.add(location);
}
return result;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,9 @@ public String toString() {
*/
Credentials getCredentials(MavenRepositoryLocation location);

/**
* Returns all configured mirror locations.
*/
Iterable<MavenRepositoryLocation> getMirrors();

}

0 comments on commit b1a693f

Please sign in to comment.