Class RepositoryUriResolver
java.lang.Object
org.jenkinsci.plugins.github_branch_source.RepositoryUriResolver
- Direct Known Subclasses:
HttpsRepositoryUriResolver
,SshRepositoryUriResolver
Resolves the URI of a GitHub repository from the API URI, owner and repository name.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract String
getRepositoryUri
(String apiUri, String owner, String repository) Resolves the URI of a repository.static String
hostnameFromApiUri
(String apiUri) Helper method that returns the hostname of a GitHub server from its API URL.
-
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
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
-