{"action":"closed","issue":{"url":"https://api.github.com/repos/gmessner/gitlab4j-api/issues/284","repository_url":"https://api.github.com/repos/gmessner/gitlab4j-api","labels_url":"https://api.github.com/repos/gmessner/gitlab4j-api/issues/284/labels{/name}","comments_url":"https://api.github.com/repos/gmessner/gitlab4j-api/issues/284/comments","events_url":"https://api.github.com/repos/gmessner/gitlab4j-api/issues/284/events","html_url":"https://github.com/gmessner/gitlab4j-api/issues/284","id":391358065,"node_id":"MDU6SXNzdWUzOTEzNTgwNjU=","number":284,"title":"Project API add avatar","user":{"login":"jflefebvre06","id":2685607,"node_id":"MDQ6VXNlcjI2ODU2MDc=","avatar_url":"https://avatars3.githubusercontent.com/u/2685607?v=4","gravatar_id":"","url":"https://api.github.com/users/jflefebvre06","html_url":"https://github.com/jflefebvre06","followers_url":"https://api.github.com/users/jflefebvre06/followers","following_url":"https://api.github.com/users/jflefebvre06/following{/other_user}","gists_url":"https://api.github.com/users/jflefebvre06/gists{/gist_id}","starred_url":"https://api.github.com/users/jflefebvre06/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jflefebvre06/subscriptions","organizations_url":"https://api.github.com/users/jflefebvre06/orgs","repos_url":"https://api.github.com/users/jflefebvre06/repos","events_url":"https://api.github.com/users/jflefebvre06/events{/privacy}","received_events_url":"https://api.github.com/users/jflefebvre06/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-12-15T08:39:04Z","updated_at":"2018-12-17T09:21:20Z","closed_at":"2018-12-17T09:21:19Z","author_association":"NONE","body":"Hello,\r\n\r\nCould you please add a method to add avatar to projet. Below a sample can help you\r\n\r\n```java\r\npublic Project addProjectAvatar(final Project project, final File fileToUpload) throws GitLabApiException {\r\n        Validate.notNull(project, \"project cannot be null\");\r\n        Validate.notNull(fileToUpload, \"fileToUpload cannot be null\");\r\n        Validate.isTrue(fileToUpload.isFile(), \"fileToUpload is not a file\");\r\n        try {\r\n            final MultipartEntityBuilder builder = MultipartEntityBuilder.create();\r\n            builder.setMode(HttpMultipartMode.BROWSER_COMPATIBLE);\r\n            builder.addBinaryBody(\"avatar\", fileToUpload, ContentType.DEFAULT_BINARY, fileToUpload.getName());\r\n            // Si on ne passe que l'avatar on obtien une erreur\r\n            builder.addTextBody(\"name\", project.getName(), ContentType.DEFAULT_BINARY);\r\n            final HttpPut put = new HttpPut(this.gitLabApi.getGitLabServerUrl() + this.gitLabApi.getApiVersion().getApiNamespace() + \"/projects/\" + project.getId());\r\n            put.setHeader(\"PRIVATE-TOKEN\", this.gitLabApi.getAuthToken());\r\n            put.setEntity(builder.build());\r\n            // FIXME Gestion du proxy\r\n            final HttpClient client = HttpClientBuilder.create().build();\r\n            final HttpResponse response = client.execute(put);\r\n            final int statusCode = response.getStatusLine().getStatusCode();\r\n            final HttpEntity responseEntity = response.getEntity();\r\n            ...\r\n        } catch (final IOException ioException) {\r\n            throw new GitLabApiException(ioException);\r\n        }\r\n    }\r\n```"}}
{"actor":{"display_login":"jflefebvre06"}}