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
6defea44
Commit
6defea44
authored
Mar 14, 2020
by
Greg Messner
Browse files
Added setGroupAvatar() (#533)
parent
08fa8df0
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/gitlab4j/api/GroupApi.java
View file @
6defea44
package
org.gitlab4j.api
;
import
java.io.File
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Optional
;
...
...
@@ -1471,4 +1472,20 @@ public class GroupApi extends AbstractApi {
Response
response
=
get
(
Response
.
Status
.
OK
,
formData
.
asMap
(),
"groups"
,
getGroupIdOrPath
(
groupIdOrPath
),
"badges"
,
"render"
);
return
(
response
.
readEntity
(
Badge
.
class
));
}
/**
* Uploads and sets the project avatar for the specified group.
*
* <pre><code>GitLab Endpoint: PUT /groups/:id</code></pre>
*
* @param groupIdOrPath the group ID, path of the group, or a Group instance holding the group ID or path
* @param avatarFile the File instance of the avatar file to upload
* @return the updated Group instance
* @throws GitLabApiException if any exception occurs
*/
public
Group
setGroupAvatar
(
Object
groupIdOrPath
,
File
avatarFile
)
throws
GitLabApiException
{
Response
response
=
putUpload
(
Response
.
Status
.
OK
,
"avatar"
,
avatarFile
,
"groups"
,
getGroupIdOrPath
(
groupIdOrPath
));
return
(
response
.
readEntity
(
Group
.
class
));
}
}
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