{"action":"created","comment":{"url":"https://api.github.com/repos/nuxeo/nuxeo/pulls/comments/170996600","pull_request_review_id":99735357,"id":170996600,"diff_hunk":"@@ -104,6 +110,78 @@\n \n     public static final String UPLOAD_TYPE_CHUNKED = \"chunked\";\n \n+    private BatchManager batchManager;\n+\n+\n+    @Override protected void initialize(Object... args) {\n+        super.initialize(args);\n+        batchManager = Framework.getService(BatchManager.class);\n+    }\n+\n+    @GET\n+    @Path(\"handlers\")\n+    public Response providers() throws IOException {\n+        Map<String, BatchHandler> supportedHandlers = batchManager.getSupportedHandlers();\n+        Map<String, Object> result = new HashMap<>();\n+\n+        result.put(\"handlers\",\n+                supportedHandlers.entrySet()\n+                                 .stream()\n+                                 .map(entry -> Collections.singletonMap(\"name\",\n+                                         entry.getKey()))\n+                                 .collect(Collectors.toList())\n+        );\n+\n+        return buildResponse(Status.OK, result);\n+    }\n+\n+    @GET\n+    @Path(\"handlers/{handlerId}\")\n+    public Response getProviderInfo(@PathParam(\"handlerId\") String handlerId) throws IOException {\n+        BatchHandler handler = batchManager.getHandlerByName(handlerId);\n+\n+        if (handler == null) {\n+            return Response.status(Status.NOT_FOUND).build();\n+        }\n+\n+        Map<String, Object> result = new HashMap<>();\n+        result.put(\"name\", handler.getName());\n+\n+        return buildResponse(Status.OK, result);\n+    }\n+\n+    @POST\n+    @Path(\"new/{providerId}\")\n+    public Response createNewBatch(@Context UriInfo uriInfo, @PathParam(\"providerId\") String providerId) throws IOException {\n+        if (StringUtils.isEmpty(providerId)) {\n+            String batchId = initBatchInternal();\n+            return Response.seeOther(\n+                    UriBuilder\n+                        .fromResource(BatchUploadObject.class)\n+                        .path(\"/{batchId}\")\n+                        .build(batchId)\n+                    ).build();\n+        }\n+\n+        Batch batch = initBatchInternal(providerId);\n+\n+        return Response.seeOther(\n+                UriBuilder\n+                        .fromPath(getContext().head().getPath().replace(\"/nuxeo/site\", StringUtils.EMPTY))\n+                        .path(\"/upload/{batchId}/info\")\n+                        .build(batch.getKey())\n+        ).build();\n+    }\n+\n+\n+    private String initBatchInternal() {\n+        return batchManager.initBatch();\n+    }\n+\n+    private Batch initBatchInternal(String providerName) {\n+        return batchManager.initBatch(providerName);","path":"nuxeo-features/rest-api/nuxeo-rest-api-server/src/main/java/org/nuxeo/ecm/restapi/server/jaxrs/BatchUploadObject.java","position":133,"original_position":133,"commit_id":"d3dec039a1d46a79a26c940e4aa3a25df5dfe92e","original_commit_id":"d3dec039a1d46a79a26c940e4aa3a25df5dfe92e","user":{"login":"efge","id":592810,"avatar_url":"https://avatars3.githubusercontent.com/u/592810?v=4","gravatar_id":"","url":"https://api.github.com/users/efge","html_url":"https://github.com/efge","followers_url":"https://api.github.com/users/efge/followers","following_url":"https://api.github.com/users/efge/following{/other_user}","gists_url":"https://api.github.com/users/efge/gists{/gist_id}","starred_url":"https://api.github.com/users/efge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/efge/subscriptions","organizations_url":"https://api.github.com/users/efge/orgs","repos_url":"https://api.github.com/users/efge/repos","events_url":"https://api.github.com/users/efge/events{/privacy}","received_events_url":"https://api.github.com/users/efge/received_events","type":"User","site_admin":false},"body":"Inline these two trivial methods, they don't bring anything.","created_at":"2018-02-27T17:09:57Z","updated_at":"2018-02-27T17:14:17Z","html_url":"https://github.com/nuxeo/nuxeo/pull/1752#discussion_r170996600","pull_request_url":"https://api.github.com/repos/nuxeo/nuxeo/pulls/1752","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/nuxeo/nuxeo/pulls/comments/170996600"},"html":{"href":"https://github.com/nuxeo/nuxeo/pull/1752#discussion_r170996600"},"pull_request":{"href":"https://api.github.com/repos/nuxeo/nuxeo/pulls/1752"}}},"pull_request":{"url":"https://api.github.com/repos/nuxeo/nuxeo/pulls/1752","id":170259201,"html_url":"https://github.com/nuxeo/nuxeo/pull/1752","diff_url":"https://github.com/nuxeo/nuxeo/pull/1752.diff","patch_url":"https://github.com/nuxeo/nuxeo/pull/1752.patch","issue_url":"https://api.github.com/repos/nuxeo/nuxeo/issues/1752","number":1752,"state":"open","locked":false,"title":"Feature/nxp 24208 allow reference s3 batch uploads","user":{"login":"driverpt","id":1164534,"avatar_url":"https://avatars0.githubusercontent.com/u/1164534?v=4","gravatar_id":"","url":"https://api.github.com/users/driverpt","html_url":"https://github.com/driverpt","followers_url":"https://api.github.com/users/driverpt/followers","following_url":"https://api.github.com/users/driverpt/following{/other_user}","gists_url":"https://api.github.com/users/driverpt/gists{/gist_id}","starred_url":"https://api.github.com/users/driverpt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/driverpt/subscriptions","organizations_url":"https://api.github.com/users/driverpt/orgs","repos_url":"https://api.github.com/users/driverpt/repos","events_url":"https://api.github.com/users/driverpt/events{/privacy}","received_events_url":"https://api.github.com/users/driverpt/received_events","type":"User","site_admin":false},"body":"⚠️DO NOT MERGE ⚠️ \r\n\r\nThis PR is opened for Review Purposes\r\n\r\nNotes: There are some Hacks on this PR that will be removed once their code is merged into master","created_at":"2018-02-20T17:31:11Z","updated_at":"2018-02-27T17:14:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e6914935e5d508cd0d54e509b64ccdb6bd50b2fa","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/nuxeo/nuxeo/pulls/1752/commits","review_comments_url":"https://api.github.com/repos/nuxeo/nuxeo/pulls/1752/comments","review_comment_url":"https://api.github.com/repos/nuxeo/nuxeo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nuxeo/nuxeo/issues/1752/comments","statuses_url":"https://api.github.com/repos/nuxeo/nuxeo/statuses/d3dec039a1d46a79a26c940e4aa3a25df5dfe92e","head":{"label":"nuxeo:feature/NXP-24208-allow-reference-s3-batch-uploads","ref":"feature/NXP-24208-allow-reference-s3-batch-uploads","sha":"d3dec039a1d46a79a26c940e4aa3a25df5dfe92e","user":{"login":"nuxeo","id":460607,"avatar_url":"https://avatars1.githubusercontent.com/u/460607?v=4","gravatar_id":"","url":"https://api.github.com/users/nuxeo","html_url":"https://github.com/nuxeo","followers_url":"https://api.github.com/users/nuxeo/followers","following_url":"https://api.github.com/users/nuxeo/following{/other_user}","gists_url":"https://api.github.com/users/nuxeo/gists{/gist_id}","starred_url":"https://api.github.com/users/nuxeo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nuxeo/subscriptions","organizations_url":"https://api.github.com/users/nuxeo/orgs","repos_url":"https://api.github.com/users/nuxeo/repos","events_url":"https://api.github.com/users/nuxeo/events{/privacy}","received_events_url":"https://api.github.com/users/nuxeo/received_events","type":"Organization","site_admin":false},"repo":{"id":2988101,"name":"nuxeo","full_name":"nuxeo/nuxeo","owner":{"login":"nuxeo","id":460607,"avatar_url":"https://avatars1.githubusercontent.com/u/460607?v=4","gravatar_id":"","url":"https://api.github.com/users/nuxeo","html_url":"https://github.com/nuxeo","followers_url":"https://api.github.com/users/nuxeo/followers","following_url":"https://api.github.com/users/nuxeo/following{/other_user}","gists_url":"https://api.github.com/users/nuxeo/gists{/gist_id}","starred_url":"https://api.github.com/users/nuxeo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nuxeo/subscriptions","organizations_url":"https://api.github.com/users/nuxeo/orgs","repos_url":"https://api.github.com/users/nuxeo/repos","events_url":"https://api.github.com/users/nuxeo/events{/privacy}","received_events_url":"https://api.github.com/users/nuxeo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nuxeo/nuxeo","description":"Content management platform to build modern business applications","fork":false,"url":"https://api.github.com/repos/nuxeo/nuxeo","forks_url":"https://api.github.com/repos/nuxeo/nuxeo/forks","keys_url":"https://api.github.com/repos/nuxeo/nuxeo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nuxeo/nuxeo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nuxeo/nuxeo/teams","hooks_url":"https://api.github.com/repos/nuxeo/nuxeo/hooks","issue_events_url":"https://api.github.com/repos/nuxeo/nuxeo/issues/events{/number}","events_url":"https://api.github.com/repos/nuxeo/nuxeo/events","assignees_url":"https://api.github.com/repos/nuxeo/nuxeo/assignees{/user}","branches_url":"https://api.github.com/repos/nuxeo/nuxeo/branches{/branch}","tags_url":"https://api.github.com/repos/nuxeo/nuxeo/tags","blobs_url":"https://api.github.com/repos/nuxeo/nuxeo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nuxeo/nuxeo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nuxeo/nuxeo/git/refs{/sha}","trees_url":"https://api.github.com/repos/nuxeo/nuxeo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nuxeo/nuxeo/statuses/{sha}","languages_url":"https://api.github.com/repos/nuxeo/nuxeo/languages","stargazers_url":"https://api.github.com/repos/nuxeo/nuxeo/stargazers","contributors_url":"https://api.github.com/repos/nuxeo/nuxeo/contributors","subscribers_url":"https://api.github.com/repos/nuxeo/nuxeo/subscribers","subscription_url":"https://api.github.com/repos/nuxeo/nuxeo/subscription","commits_url":"https://api.github.com/repos/nuxeo/nuxeo/commits{/sha}","git_commits_url":"https://api.github.com/repos/nuxeo/nuxeo/git/commits{/sha}","comments_url":"https://api.github.com/repos/nuxeo/nuxeo/comments{/number}","issue_comment_url":"https://api.github.com/repos/nuxeo/nuxeo/issues/comments{/number}","contents_url":"https://api.github.com/repos/nuxeo/nuxeo/contents/{+path}","compare_url":"https://api.github.com/repos/nuxeo/nuxeo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nuxeo/nuxeo/merges","archive_url":"https://api.github.com/repos/nuxeo/nuxeo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nuxeo/nuxeo/downloads","issues_url":"https://api.github.com/repos/nuxeo/nuxeo/issues{/number}","pulls_url":"https://api.github.com/repos/nuxeo/nuxeo/pulls{/number}","milestones_url":"https://api.github.com/repos/nuxeo/nuxeo/milestones{/number}","notifications_url":"https://api.github.com/repos/nuxeo/nuxeo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nuxeo/nuxeo/labels{/name}","releases_url":"https://api.github.com/repos/nuxeo/nuxeo/releases{/id}","deployments_url":"https://api.github.com/repos/nuxeo/nuxeo/deployments","created_at":"2011-12-15T14:35:41Z","updated_at":"2018-02-21T08:07:23Z","pushed_at":"2018-02-27T17:05:41Z","git_url":"git://github.com/nuxeo/nuxeo.git","ssh_url":"git@github.com:nuxeo/nuxeo.git","clone_url":"https://github.com/nuxeo/nuxeo.git","svn_url":"https://github.com/nuxeo/nuxeo","homepage":"http://www.nuxeo.com","size":224173,"stargazers_count":191,"watchers_count":191,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":142,"mirror_url":null,"archived":false,"open_issues_count":12,"license":null,"forks":142,"open_issues":12,"watchers":191,"default_branch":"master"}},"base":{"label":"nuxeo:master","ref":"master","sha":"bf45120bb851c6ae391b8a2c0ea8d3b4172359f9","user":{"login":"nuxeo","id":460607,"avatar_url":"https://avatars1.githubusercontent.com/u/460607?v=4","gravatar_id":"","url":"https://api.github.com/users/nuxeo","html_url":"https://github.com/nuxeo","followers_url":"https://api.github.com/users/nuxeo/followers","following_url":"https://api.github.com/users/nuxeo/following{/other_user}","gists_url":"https://api.github.com/users/nuxeo/gists{/gist_id}","starred_url":"https://api.github.com/users/nuxeo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nuxeo/subscriptions","organizations_url":"https://api.github.com/users/nuxeo/orgs","repos_url":"https://api.github.com/users/nuxeo/repos","events_url":"https://api.github.com/users/nuxeo/events{/privacy}","received_events_url":"https://api.github.com/users/nuxeo/received_events","type":"Organization","site_admin":false},"repo":{"id":2988101,"name":"nuxeo","full_name":"nuxeo/nuxeo","owner":{"login":"nuxeo","id":460607,"avatar_url":"https://avatars1.githubusercontent.com/u/460607?v=4","gravatar_id":"","url":"https://api.github.com/users/nuxeo","html_url":"https://github.com/nuxeo","followers_url":"https://api.github.com/users/nuxeo/followers","following_url":"https://api.github.com/users/nuxeo/following{/other_user}","gists_url":"https://api.github.com/users/nuxeo/gists{/gist_id}","starred_url":"https://api.github.com/users/nuxeo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nuxeo/subscriptions","organizations_url":"https://api.github.com/users/nuxeo/orgs","repos_url":"https://api.github.com/users/nuxeo/repos","events_url":"https://api.github.com/users/nuxeo/events{/privacy}","received_events_url":"https://api.github.com/users/nuxeo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nuxeo/nuxeo","description":"Content management platform to build modern business applications","fork":false,"url":"https://api.github.com/repos/nuxeo/nuxeo","forks_url":"https://api.github.com/repos/nuxeo/nuxeo/forks","keys_url":"https://api.github.com/repos/nuxeo/nuxeo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nuxeo/nuxeo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nuxeo/nuxeo/teams","hooks_url":"https://api.github.com/repos/nuxeo/nuxeo/hooks","issue_events_url":"https://api.github.com/repos/nuxeo/nuxeo/issues/events{/number}","events_url":"https://api.github.com/repos/nuxeo/nuxeo/events","assignees_url":"https://api.github.com/repos/nuxeo/nuxeo/assignees{/user}","branches_url":"https://api.github.com/repos/nuxeo/nuxeo/branches{/branch}","tags_url":"https://api.github.com/repos/nuxeo/nuxeo/tags","blobs_url":"https://api.github.com/repos/nuxeo/nuxeo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nuxeo/nuxeo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nuxeo/nuxeo/git/refs{/sha}","trees_url":"https://api.github.com/repos/nuxeo/nuxeo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nuxeo/nuxeo/statuses/{sha}","languages_url":"https://api.github.com/repos/nuxeo/nuxeo/languages","stargazers_url":"https://api.github.com/repos/nuxeo/nuxeo/stargazers","contributors_url":"https://api.github.com/repos/nuxeo/nuxeo/contributors","subscribers_url":"https://api.github.com/repos/nuxeo/nuxeo/subscribers","subscription_url":"https://api.github.com/repos/nuxeo/nuxeo/subscription","commits_url":"https://api.github.com/repos/nuxeo/nuxeo/commits{/sha}","git_commits_url":"https://api.github.com/repos/nuxeo/nuxeo/git/commits{/sha}","comments_url":"https://api.github.com/repos/nuxeo/nuxeo/comments{/number}","issue_comment_url":"https://api.github.com/repos/nuxeo/nuxeo/issues/comments{/number}","contents_url":"https://api.github.com/repos/nuxeo/nuxeo/contents/{+path}","compare_url":"https://api.github.com/repos/nuxeo/nuxeo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nuxeo/nuxeo/merges","archive_url":"https://api.github.com/repos/nuxeo/nuxeo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nuxeo/nuxeo/downloads","issues_url":"https://api.github.com/repos/nuxeo/nuxeo/issues{/number}","pulls_url":"https://api.github.com/repos/nuxeo/nuxeo/pulls{/number}","milestones_url":"https://api.github.com/repos/nuxeo/nuxeo/milestones{/number}","notifications_url":"https://api.github.com/repos/nuxeo/nuxeo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nuxeo/nuxeo/labels{/name}","releases_url":"https://api.github.com/repos/nuxeo/nuxeo/releases{/id}","deployments_url":"https://api.github.com/repos/nuxeo/nuxeo/deployments","created_at":"2011-12-15T14:35:41Z","updated_at":"2018-02-21T08:07:23Z","pushed_at":"2018-02-27T17:05:41Z","git_url":"git://github.com/nuxeo/nuxeo.git","ssh_url":"git@github.com:nuxeo/nuxeo.git","clone_url":"https://github.com/nuxeo/nuxeo.git","svn_url":"https://github.com/nuxeo/nuxeo","homepage":"http://www.nuxeo.com","size":224173,"stargazers_count":191,"watchers_count":191,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":142,"mirror_url":null,"archived":false,"open_issues_count":12,"license":null,"forks":142,"open_issues":12,"watchers":191,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nuxeo/nuxeo/pulls/1752"},"html":{"href":"https://github.com/nuxeo/nuxeo/pull/1752"},"issue":{"href":"https://api.github.com/repos/nuxeo/nuxeo/issues/1752"},"comments":{"href":"https://api.github.com/repos/nuxeo/nuxeo/issues/1752/comments"},"review_comments":{"href":"https://api.github.com/repos/nuxeo/nuxeo/pulls/1752/comments"},"review_comment":{"href":"https://api.github.com/repos/nuxeo/nuxeo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nuxeo/nuxeo/pulls/1752/commits"},"statuses":{"href":"https://api.github.com/repos/nuxeo/nuxeo/statuses/d3dec039a1d46a79a26c940e4aa3a25df5dfe92e"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"efge"}}