|
5 | 5 | import com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketApiFactory;
|
6 | 6 | import com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketAuthenticator;
|
7 | 7 | import com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketRequestException;
|
| 8 | +import com.cloudbees.jenkins.plugins.bitbucket.client.BitbucketCloudApiClient; |
8 | 9 | import com.cloudbees.jenkins.plugins.bitbucket.endpoints.BitbucketCloudEndpoint;
|
9 | 10 | import com.cloudbees.jenkins.plugins.bitbucket.endpoints.BitbucketEndpointConfiguration;
|
10 | 11 | import com.cloudbees.plugins.credentials.CredentialsProvider;
|
|
26 | 27 | @Restricted(NoExternalUse.class)
|
27 | 28 | public class BitbucketApiUtils {
|
28 | 29 |
|
29 |
| - private static final Logger LOGGER = Logger.getLogger(BitbucketApiUtils.class.getName()); |
| 30 | + private static final Logger logger = Logger.getLogger(BitbucketApiUtils.class.getName()); |
| 31 | + |
| 32 | + public static boolean isCloud(BitbucketApi client) { |
| 33 | + return client instanceof BitbucketCloudApiClient; |
| 34 | + } |
30 | 35 |
|
31 | 36 | public static ListBoxModel getFromBitbucket(SCMSourceOwner context,
|
32 | 37 | String serverUrl,
|
@@ -82,10 +87,10 @@ public static ListBoxModel getFromBitbucket(SCMSourceOwner context,
|
82 | 87 | : Messages.BitbucketSCMSource_UnauthorizedOwner(repoOwner)).withSelectionCleared();
|
83 | 88 | }
|
84 | 89 | }
|
85 |
| - LOGGER.log(Level.SEVERE, e.getMessage(), e); |
| 90 | + logger.log(Level.SEVERE, e.getMessage(), e); |
86 | 91 | throw FormFillFailure.error(e.getMessage());
|
87 | 92 | } catch (Throwable e) {
|
88 |
| - LOGGER.log(Level.SEVERE, e.getMessage(), e); |
| 93 | + logger.log(Level.SEVERE, e.getMessage(), e); |
89 | 94 | throw FormFillFailure.error(e.getMessage());
|
90 | 95 | }
|
91 | 96 | }
|
|
0 commit comments