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
8119a0ed
Commit
8119a0ed
authored
Dec 15, 2018
by
Greg Messner
Browse files
Added setProjectAvatar() (#284).
parent
4a7bb823
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/gitlab4j/api/ProjectApi.java
View file @
8119a0ed
...
@@ -2387,4 +2387,34 @@ public class ProjectApi extends AbstractApi implements Constants {
...
@@ -2387,4 +2387,34 @@ public class ProjectApi extends AbstractApi implements Constants {
Response
response
=
put
(
Response
.
Status
.
OK
,
formData
.
asMap
(),
"projects"
,
getProjectIdOrPath
(
projectIdOrPath
),
"transfer"
);
Response
response
=
put
(
Response
.
Status
.
OK
,
formData
.
asMap
(),
"projects"
,
getProjectIdOrPath
(
projectIdOrPath
),
"transfer"
);
return
(
response
.
readEntity
(
Project
.
class
));
return
(
response
.
readEntity
(
Project
.
class
));
}
}
/**
* Uploads and sets the project avatar for the specified project
*
* <pre><code>PUT /projects/:id/uploads</code></pre>
*
* @param projectIdOrPath projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance, required
* @param avatarFile the File instance of the avatar file to upload
* @return the updated Project instance
* @throws GitLabApiException if any exception occurs
*/
public
Project
setProjectAvatar
(
Object
projectIdOrPath
,
File
fileToUpload
)
throws
GitLabApiException
{
return
(
setProjectAvatar
(
projectIdOrPath
,
fileToUpload
,
null
));
}
/**
* Uploads and sets the project avatar for the specified project.
*
* <pre><code>PUT /projects/:id/uploads</code></pre>
*
* @param projectIdOrPath projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance, required
* @param avatarFile the File instance of the avatar file to upload
* @param mediaType the media type of the avatar file to upload, optional
* @return the updated Project instance
* @throws GitLabApiException if any exception occurs
*/
public
Project
setProjectAvatar
(
Object
projectIdOrPath
,
File
avatarFile
,
String
mediaType
)
throws
GitLabApiException
{
Response
response
=
putUpload
(
Response
.
Status
.
OK
,
"avatar"
,
avatarFile
,
mediaType
,
"projects"
,
getProjectIdOrPath
(
projectIdOrPath
));
return
(
response
.
readEntity
(
Project
.
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