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
76900ce0
Commit
76900ce0
authored
May 02, 2020
by
Greg Messner
Browse files
Addd support for getting license and custom attributes (#567)
parent
d7c3c76b
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/gitlab4j/api/ProjectApi.java
View file @
76900ce0
...
@@ -670,8 +670,7 @@ public class ProjectApi extends AbstractApi implements Constants {
...
@@ -670,8 +670,7 @@ public class ProjectApi extends AbstractApi implements Constants {
* @throws GitLabApiException if any exception occurs
* @throws GitLabApiException if any exception occurs
*/
*/
public
Project
getProject
(
Object
projectIdOrPath
)
throws
GitLabApiException
{
public
Project
getProject
(
Object
projectIdOrPath
)
throws
GitLabApiException
{
Response
response
=
get
(
Response
.
Status
.
OK
,
null
,
"projects"
,
this
.
getProjectIdOrPath
(
projectIdOrPath
));
return
(
getProject
(
projectIdOrPath
,
null
,
null
,
null
));
return
(
response
.
readEntity
(
Project
.
class
));
}
}
/**
/**
...
@@ -684,7 +683,7 @@ public class ProjectApi extends AbstractApi implements Constants {
...
@@ -684,7 +683,7 @@ public class ProjectApi extends AbstractApi implements Constants {
*/
*/
public
Optional
<
Project
>
getOptionalProject
(
Object
projectIdOrPath
)
{
public
Optional
<
Project
>
getOptionalProject
(
Object
projectIdOrPath
)
{
try
{
try
{
return
(
Optional
.
ofNullable
(
getProject
(
projectIdOrPath
)));
return
(
Optional
.
ofNullable
(
getProject
(
projectIdOrPath
,
null
,
null
,
null
)));
}
catch
(
GitLabApiException
glae
)
{
}
catch
(
GitLabApiException
glae
)
{
return
(
GitLabApi
.
createOptionalFromException
(
glae
));
return
(
GitLabApi
.
createOptionalFromException
(
glae
));
}
}
...
@@ -701,9 +700,7 @@ public class ProjectApi extends AbstractApi implements Constants {
...
@@ -701,9 +700,7 @@ public class ProjectApi extends AbstractApi implements Constants {
* @throws GitLabApiException if any exception occurs
* @throws GitLabApiException if any exception occurs
*/
*/
public
Project
getProject
(
Object
projectIdOrPath
,
Boolean
includeStatistics
)
throws
GitLabApiException
{
public
Project
getProject
(
Object
projectIdOrPath
,
Boolean
includeStatistics
)
throws
GitLabApiException
{
Form
formData
=
new
GitLabApiForm
().
withParam
(
"statistics"
,
includeStatistics
);
return
(
getProject
(
projectIdOrPath
,
includeStatistics
,
null
,
null
));
Response
response
=
get
(
Response
.
Status
.
OK
,
formData
.
asMap
(),
"projects"
,
this
.
getProjectIdOrPath
(
projectIdOrPath
));
return
(
response
.
readEntity
(
Project
.
class
));
}
}
/**
/**
...
@@ -717,7 +714,7 @@ public class ProjectApi extends AbstractApi implements Constants {
...
@@ -717,7 +714,7 @@ public class ProjectApi extends AbstractApi implements Constants {
*/
*/
public
Optional
<
Project
>
getOptionalProject
(
Object
projectIdOrPath
,
Boolean
includeStatistics
)
{
public
Optional
<
Project
>
getOptionalProject
(
Object
projectIdOrPath
,
Boolean
includeStatistics
)
{
try
{
try
{
return
(
Optional
.
ofNullable
(
getProject
(
projectIdOrPath
,
includeStatistics
)));
return
(
Optional
.
ofNullable
(
getProject
(
projectIdOrPath
,
includeStatistics
,
null
,
null
)));
}
catch
(
GitLabApiException
glae
)
{
}
catch
(
GitLabApiException
glae
)
{
return
(
GitLabApi
.
createOptionalFromException
(
glae
));
return
(
GitLabApi
.
createOptionalFromException
(
glae
));
}
}
...
...
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