List getURIs()

in github-plugin/src/main/java/com/googlesource/gerrit/plugins/github/replication/Destination.java [69:93]


  List<URIish> getURIs(Project.NameKey project, String urlMatch) {
    List<URIish> r = Lists.newArrayListWithCapacity(remote.getURIs().size());
    for (URIish uri : remote.getURIs()) {
      if (matches(uri, urlMatch)) {
        String name = project.get();
        if (needsUrlEncoding(uri)) {
          name = encode(name);
        }
        if (remoteNameStyle.equals("dash")) {
          name = name.replace("/", "-");
        } else if (remoteNameStyle.equals("underscore")) {
          name = name.replace("/", "_");
        } else if (!remoteNameStyle.equals("slash")) {
          GitHubDestinations.log.debug(
              String.format("Unknown remoteNameStyle: %s, falling back to slash", remoteNameStyle));
        }
        String replacedPath = GitHubDestinations.replaceName(uri.getPath(), name);
        if (replacedPath != null) {
          uri = uri.setPath(replacedPath);
          r.add(uri);
        }
      }
    }
    return r;
  }