Class RepositoryUriResolver

java.lang.Object
org.jenkinsci.plugins.github_branch_source.RepositoryUriResolver
Direct Known Subclasses:
HttpsRepositoryUriResolver, SshRepositoryUriResolver

public abstract class RepositoryUriResolver extends Object
Resolves the URI of a GitHub repository from the API URI, owner and repository name.
  • Constructor Details

    • RepositoryUriResolver

      public RepositoryUriResolver()
  • Method Details

    • getRepositoryUri

      @NonNull public abstract String getRepositoryUri(@NonNull String apiUri, @NonNull String owner, @NonNull String repository)
      Resolves the URI of a repository.
      Parameters:
      apiUri - the API URL of the GitHub server.
      owner - the owner of the repository.
      repository - the name of the repository.
      Returns:
      the GIT URL of the repository.
    • hostnameFromApiUri

      @NonNull public static String hostnameFromApiUri(@CheckForNull String apiUri)
      Helper method that returns the hostname of a GitHub server from its API URL.
      Parameters:
      apiUri - the API URL.
      Returns:
      the hostname of a GitHub server