Interface GitService

  • All Known Implementing Classes:
    GitHub, GitLab

    public interface GitService
    An abstraction over Git services.
    • Method Detail

      • supports

        boolean supports​(GitServiceFeature feature)
        Safely checks if the underlying implementation supports the given operation. If this method returns true then the underlying class will not raise any UnsupportedOperationException when invoking the specific methods.
        Parameters:
        feature - the feature to check for support.
        Returns:
        true if the operation is supported, false otherwise
      • getBaseURI

        URI getBaseURI()
        Returns the API base URI for the service instance.
        Returns:
        the API base URI for the service instance
      • ping

        boolean ping()
        Tries to contact the remote server to verify it's reachable and healthy. Please note that this method sends unauthenticated requests that may fail because of rate limits so use it with care.
        Returns:
        true if the operation succeeds, false otherwise
        Throws:
        UnsupportedOperationException - if the underlying implementation does not support the GitServiceFeature.PING feature.