This project provides a full featured Java API for working with GitLab repositories via the standard GitLab REST API.
This project provides a full featured Java API for working with GitLab repositories via the standard GitLab REST API.
It is quite simple to use, all you need is the URL to your GitLab server and the Private Token from your GitLab Account Settings page. Once you have that info it is as simple as:
It is quite simple to use, all you need is the URL to your GitLab server and the Private Token from your GitLab Account Settings page. Once you have that info it is as simple as:
'''java
// Create a GitLabApi instance to communicate with your GitLab server
// Create a GitLabApi instance to communicate with your GitLab server
GitLabApi gitLabApi = new GitLabApi("http://your.gitlab.serbver.com", "YOUR_PRIVATE_TOKEN");
GitLabApi gitLabApi = new GitLabApi("http://your.gitlab.serbver.com", "YOUR_PRIVATE_TOKEN");
// Get the list of projects your account has access to
// Get the list of projects your account has access to
The API has been broken up into sub APIs classes to make it easier to learn and to separate concerns. Following is a list of the sub APIs along with a sample use of each API. See the Javadocs for a complete list of available methods for each sub API.
The API has been broken up into sub APIs classes to make it easier to learn and to separate concerns. Following is a list of the sub APIs along with a sample use of each API. See the Javadocs for a complete list of available methods for each sub API.
Available Sub APIs
Available Sub APIs
------------------
------------------
'''
CommitsApi
CommitsApi
GroupApi
GroupApi
MergeRequestApi
MergeRequestApi
ProjectApi
ProjectApi
RepositoryApi
RepositoryApi
UserApi
UserApi
'''
CommitsApi:
CommitsApi:
'''java
// Get a list of commits associated with the specified branch
// Get a list of commits associated with the specified branch