Class GitLab

    • Method Detail

      • instance

        public static GitLab instance​(String apiURI)
                               throws GitTransportException
        Returns an instance using the given API URI.
        Parameters:
        apiURI - the API URI, which is usually the endpoint to a private or on premises installation
        Returns:
        an instance using the given API URI
        Throws:
        GitTransportException - if the given URI can't be reached or does not expose valid APIs
        NullPointerException - if the given URI is null
        IllegalArgumentException - if the given URI is illegal (i.e. empty or malformed)
      • instance

        public static GitLab instance​(URI apiURI)
                               throws GitTransportException
        Returns an instance using the given API URI.
        Parameters:
        apiURI - the API URI, which is usually the endpoint to a private or on premises installation
        Returns:
        an instance using the given API URI
        Throws:
        GitTransportException - if the given URI can't be reached or does not expose valid APIs
        NullPointerException - if the given URI is null
        IllegalArgumentException - if the given URI is illegal (i.e. empty or malformed)
      • supports

        public 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.
        Specified by:
        supports in interface GitService
        Parameters:
        feature - the feature to check for support.
        Returns:
        true if the operation is supported, false otherwise
      • getBaseURI

        public URI getBaseURI()
        Returns the API base URI for the service instance.
        Specified by:
        getBaseURI in interface GitService
        Returns:
        the API base URI for the service instance
      • ping

        public 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.
        Specified by:
        ping in interface GitService
        Returns:
        true if the operation succeeds, false otherwise