@@ -2387,4 +2387,34 @@ public Project transferProject(Object projectIdOrPath, String namespace) throws
2387
2387
Response response = put (Response .Status .OK , formData .asMap (), "projects" , getProjectIdOrPath (projectIdOrPath ), "transfer" );
2388
2388
return (response .readEntity (Project .class ));
2389
2389
}
2390
+
2391
+ /**
2392
+ * Uploads and sets the project avatar for the specified project
2393
+ *
2394
+ * <pre><code>PUT /projects/:id/uploads</code></pre>
2395
+ *
2396
+ * @param projectIdOrPath projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance, required
2397
+ * @param avatarFile the File instance of the avatar file to upload
2398
+ * @return the updated Project instance
2399
+ * @throws GitLabApiException if any exception occurs
2400
+ */
2401
+ public Project setProjectAvatar (Object projectIdOrPath , File fileToUpload ) throws GitLabApiException {
2402
+ return (setProjectAvatar (projectIdOrPath , fileToUpload , null ));
2403
+ }
2404
+
2405
+ /**
2406
+ * Uploads and sets the project avatar for the specified project.
2407
+ *
2408
+ * <pre><code>PUT /projects/:id/uploads</code></pre>
2409
+ *
2410
+ * @param projectIdOrPath projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance, required
2411
+ * @param avatarFile the File instance of the avatar file to upload
2412
+ * @param mediaType the media type of the avatar file to upload, optional
2413
+ * @return the updated Project instance
2414
+ * @throws GitLabApiException if any exception occurs
2415
+ */
2416
+ public Project setProjectAvatar (Object projectIdOrPath , File avatarFile , String mediaType ) throws GitLabApiException {
2417
+ Response response = putUpload (Response .Status .OK , "avatar" , avatarFile , mediaType , "projects" , getProjectIdOrPath (projectIdOrPath ));
2418
+ return (response .readEntity (Project .class ));
2419
+ }
2390
2420
}
0 commit comments