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
065d44f6
Commit
065d44f6
authored
Jul 05, 2018
by
Greg Messner
Browse files
Fixed NPE.
parent
cf7a81f1
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/gitlab4j/api/LicensesApi.java
View file @
065d44f6
package
org.gitlab4j.api
;
import
java.util.List
;
import
javax.ws.rs.core.Form
;
import
javax.ws.rs.core.GenericType
;
import
javax.ws.rs.core.Response
;
import
org.gitlab4j.api.models.LicenseTemplate
;
/**
...
...
@@ -24,8 +26,7 @@ public class LicensesApi extends AbstractApi {
* @throws GitLabApiException if any exception occurs
*/
public
List
<
LicenseTemplate
>
getAllLicenseTemplates
()
throws
GitLabApiException
{
GitLabApiForm
formData
=
null
;
Response
response
=
get
(
Response
.
Status
.
OK
,
formData
.
asMap
(),
"licenses"
);
Response
response
=
get
(
Response
.
Status
.
OK
,
null
,
"licenses"
);
return
(
response
.
readEntity
(
new
GenericType
<
List
<
LicenseTemplate
>>()
{}));
}
...
...
@@ -53,8 +54,7 @@ public class LicensesApi extends AbstractApi {
* @throws GitLabApiException if any exception occurs
*/
public
LicenseTemplate
getSingleLicenseTemplate
(
String
key
)
throws
GitLabApiException
{
GitLabApiForm
formData
=
null
;
Response
response
=
get
(
Response
.
Status
.
OK
,
formData
.
asMap
(),
"licenses"
,
key
);
Response
response
=
get
(
Response
.
Status
.
OK
,
null
,
"licenses"
,
key
);
return
(
response
.
readEntity
(
LicenseTemplate
.
class
));
}
}
\ No newline at end of file
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