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
9f32ecb9
Commit
9f32ecb9
authored
May 25, 2018
by
Greg Messner
Browse files
Added getForks() methods that return List.
parent
639ca5a5
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/gitlab4j/api/ProjectApi.java
View file @
9f32ecb9
...
@@ -2054,13 +2054,42 @@ public class ProjectApi extends AbstractApi implements Constants {
...
@@ -2054,13 +2054,42 @@ public class ProjectApi extends AbstractApi implements Constants {
delete
(
Response
.
Status
.
OK
,
null
,
"projects"
,
projectId
,
"push_rule"
);
delete
(
Response
.
Status
.
OK
,
null
,
"projects"
,
projectId
,
"push_rule"
);
}
}
/**
/**
* Get a
Pager
of projects that were forked from the specified project.
* Get a
list
of projects that were forked from the specified project.
*
*
* GET /projects/:id/forks
* GET /projects/:id/forks
*
*
* @param projectId the ID of the project
* @param projectId the ID of the project
* @return a List of forked projects
* @throws GitLabApiException if any exception occurs
*/
public
List
<
Project
>
getForks
(
Integer
projectId
)
throws
GitLabApiException
{
return
(
getForks
(
projectId
,
1
,
getDefaultPerPage
()));
}
/**
* Get a list of projects that were forked from the specified project and in the specified page range.
*
* GET /projects/:id/forks
*
* @param projectId the ID of the project
* @param page the page to get
* @param perPage the number of projects per page
* @return a List of forked projects
* @throws GitLabApiException if any exception occurs
*/
public
List
<
Project
>
getForks
(
Integer
projectId
,
int
page
,
int
perPage
)
throws
GitLabApiException
{
Response
response
=
get
(
Response
.
Status
.
OK
,
getPageQueryParams
(
page
,
perPage
),
"projects"
,
projectId
,
"forks"
);
return
(
response
.
readEntity
(
new
GenericType
<
List
<
Project
>>()
{
}));
}
/**
* Get a Pager of projects that were forked from the specified project.
*
* GET /projects/:id/forks
*
* @param projectId the ID of the project
* @param itemsPerPage the number of Project instances that will be fetched per page
* @param itemsPerPage the number of Project instances that will be fetched per page
* @return a Pager of projects
* @return a Pager of projects
* @throws GitLabApiException if any exception occurs
* @throws GitLabApiException if any exception occurs
...
...
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