Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
佳 邓
Gitlab4j Api
Commits
07a1e4d3
Commit
07a1e4d3
authored
May 25, 2018
by
Greg Messner
Browse files
Added getContributors() methods that return List.
parent
9f32ecb9
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/gitlab4j/api/RepositoryApi.java
View file @
07a1e4d3
...
...
@@ -499,7 +499,37 @@ public class RepositoryApi extends AbstractApi {
Response
response
=
get
(
Response
.
Status
.
OK
,
formData
.
asMap
(),
"projects"
,
projectPath
,
"repository"
,
"compare"
);
return
(
response
.
readEntity
(
CompareResults
.
class
));
}
/**
* Get a list of contributors from a project.
*
* GET /projects/:id/repository/contributors
*
* @param projectId the project to get the list of contributors for
* @return a List containing the contributors for the specified project ID
* @throws GitLabApiException if any exception occurs
*/
public
List
<
Contributor
>
getContributors
(
Integer
projectId
)
throws
GitLabApiException
{
return
(
getContributors
(
projectId
,
1
,
getDefaultPerPage
()));
}
/**
* Get a list of contributors from a project and in the specified page range.
*
* GET /projects/:id/repository/contributors
*
* @param projectId the project to get the list of contributors for
* @param page the page to get
* @param perPage the number of projects per page
* @return a List containing the contributors for the specified project ID
* @throws GitLabApiException if any exception occurs
*/
public
List
<
Contributor
>
getContributors
(
Integer
projectId
,
int
page
,
int
perPage
)
throws
GitLabApiException
{
Response
response
=
get
(
Response
.
Status
.
OK
,
getPageQueryParams
(
page
,
perPage
),
"projects"
,
projectId
,
"repository"
,
"contributors"
);
return
(
response
.
readEntity
(
new
GenericType
<
List
<
Contributor
>>()
{
}));
}
/**
* Get a Pager of contributors from a project.
*
...
...
@@ -507,8 +537,7 @@ public class RepositoryApi extends AbstractApi {
*
* @param projectId the project to get the list of contributors for
* @param itemsPerPage the number of Project instances that will be fetched per page
* @return the list of contributors for the specified project ID
*
* @return a Pager containing the contributors for the specified project ID
* @throws GitLabApiException if any exception occurs
*/
public
Pager
<
Contributor
>
getContributors
(
Integer
projectId
,
int
itemsPerPage
)
throws
GitLabApiException
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment