diff options
author | Zipeng WU <zipeng.wu@sonarsource.com> | 2021-05-14 17:42:12 +0200 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2021-05-21 20:03:36 +0000 |
commit | cb16d8a222d99630826a64ba891dc93b77187bfc (patch) | |
tree | 9e7a856fd789d530104ef193dd3cd4ad63584e83 /server/sonar-alm-client | |
parent | 97baa10facb3a4e6295fd7dfe93359ebd578c60f (diff) | |
download | sonarqube-cb16d8a222d99630826a64ba891dc93b77187bfc.tar.gz sonarqube-cb16d8a222d99630826a64ba891dc93b77187bfc.zip |
SONAR-14805 Import a repository from bitbucket cloud
Diffstat (limited to 'server/sonar-alm-client')
-rw-r--r-- | server/sonar-alm-client/src/main/java/org/sonar/alm/client/bitbucket/bitbucketcloud/BitbucketCloudRestClient.java | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/server/sonar-alm-client/src/main/java/org/sonar/alm/client/bitbucket/bitbucketcloud/BitbucketCloudRestClient.java b/server/sonar-alm-client/src/main/java/org/sonar/alm/client/bitbucket/bitbucketcloud/BitbucketCloudRestClient.java index 1627f75869c..ca24928fca5 100644 --- a/server/sonar-alm-client/src/main/java/org/sonar/alm/client/bitbucket/bitbucketcloud/BitbucketCloudRestClient.java +++ b/server/sonar-alm-client/src/main/java/org/sonar/alm/client/bitbucket/bitbucketcloud/BitbucketCloudRestClient.java @@ -140,6 +140,11 @@ public class BitbucketCloudRestClient { return doGetWithBasicAuth(encodedCredentials, url, r -> buildGson().fromJson(r.body().charStream(), RepositoryList.class)); } + public Repository getRepo(String encodedCredentials, String workspace, String slug) { + HttpUrl url = buildUrl(String.format("/repositories/%s/%s", workspace, slug)); + return doGetWithBasicAuth(encodedCredentials, url, r -> buildGson().fromJson(r.body().charStream(), Repository.class)); + } + public String createAccessToken(String clientId, String clientSecret) { Request request = createAccessTokenRequest(clientId, clientSecret); return doCall(request, r -> buildGson().fromJson(r.body().charStream(), Token.class)).getAccessToken(); |