Class Connector


  • public class Connector
    extends Object
    Utilities that could perhaps be moved into github-api.
    • Field Detail

      • CUSTOMIZED

        public static final org.kohsuke.github.RateLimitHandler CUSTOMIZED
        Fail immediately and throw a customized exception.
    • Method Detail

      • listScanCredentials

        @NonNull
        public static ListBoxModel listScanCredentials​(@CheckForNull
                                                       Item context,
                                                       String apiUri)
        Populates a ListBoxModel with the scan credentials appropriate for the supplied context against the supplied API endpoint.
        Parameters:
        context - the context.
        apiUri - the api endpoint.
        Returns:
        a ListBoxModel.
      • checkScanCredentials

        public static FormValidation checkScanCredentials​(@CheckForNull
                                                          Item context,
                                                          String apiUri,
                                                          String scanCredentialsId)
        Checks the credential ID for use as scan credentials in the supplied context against the supplied API endpoint.
        Parameters:
        context - the context.
        apiUri - the api endpoint.
        scanCredentialsId - the credentials ID.
        Returns:
        the FormValidation results.
      • lookupScanCredentials

        @CheckForNull
        public static com.cloudbees.plugins.credentials.common.StandardCredentials lookupScanCredentials​(@CheckForNull
                                                                                                         Item context,
                                                                                                         @CheckForNull
                                                                                                         String apiUri,
                                                                                                         @CheckForNull
                                                                                                         String scanCredentialsId)
        Resolves the specified scan credentials in the specified context for use against the specified API endpoint.
        Parameters:
        context - the context.
        apiUri - the API endpoint.
        scanCredentialsId - the credentials to resolve.
        Returns:
        the StandardCredentials or null
      • listCheckoutCredentials

        @NonNull
        public static ListBoxModel listCheckoutCredentials​(@CheckForNull
                                                           jenkins.scm.api.SCMSourceOwner context,
                                                           String apiUri)
        Retained for binary compatibility only.
        Parameters:
        context - the context.
        apiUri - the API endpoint.
        Returns:
        the StandardCredentials or null
      • listCheckoutCredentials

        @NonNull
        public static ListBoxModel listCheckoutCredentials​(@CheckForNull
                                                           Item context,
                                                           String apiUri)
        Populates a ListBoxModel with the checkout credentials appropriate for the supplied context against the supplied API endpoint.
        Parameters:
        context - the context.
        apiUri - the api endpoint.
        Returns:
        a ListBoxModel.
      • release

        public static void release​(@CheckForNull
                                   org.kohsuke.github.GitHub hub)