{"action":"created","comment":{"url":"https://api.github.com/repos/spring-projects/spring-data-mongodb/pulls/comments/200600470","pull_request_review_id":134948188,"id":200600470,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwMDYwMDQ3MA==","diff_hunk":"@@ -247,28 +246,15 @@ public GridFsResource getResource(GridFSFile file) {\n      * (non-Javadoc)\n      * @see org.springframework.core.io.support.ResourcePatternResolver#getResources(java.lang.String)\n      */\n-\tpublic GridFsResource[] getResources(String locationPattern) {\n-\n-\t\tif (!StringUtils.hasText(locationPattern)) {\n-\t\t\treturn new GridFsResource[0];\n-\t\t}\n+    public GridFsResource[] getResources(String locationPattern) {\n+        Pattern pattern = Pattern.compile(locationPattern);\n \n-\t\tAntPath path = new AntPath(locationPattern);\n+        return StreamSupport\n+                .stream(find(query(whereFilename().regex(pattern))).spliterator(), false)\n+                .map(GridFsResource::new)","path":"spring-data-mongodb/src/main/java/org/springframework/data/mongodb/gridfs/GridFsTemplate.java","position":56,"original_position":56,"commit_id":"68b907503c78b3aba1d1916938ca500fd143267a","original_commit_id":"68b907503c78b3aba1d1916938ca500fd143267a","user":{"login":"nhanft","id":31615966,"node_id":"MDQ6VXNlcjMxNjE1OTY2","avatar_url":"https://avatars2.githubusercontent.com/u/31615966?v=4","gravatar_id":"","url":"https://api.github.com/users/nhanft","html_url":"https://github.com/nhanft","followers_url":"https://api.github.com/users/nhanft/followers","following_url":"https://api.github.com/users/nhanft/following{/other_user}","gists_url":"https://api.github.com/users/nhanft/gists{/gist_id}","starred_url":"https://api.github.com/users/nhanft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nhanft/subscriptions","organizations_url":"https://api.github.com/users/nhanft/orgs","repos_url":"https://api.github.com/users/nhanft/repos","events_url":"https://api.github.com/users/nhanft/events{/privacy}","received_events_url":"https://api.github.com/users/nhanft/received_events","type":"User","site_admin":false},"body":"Yes, you are right, i misused the possibility to instatiate a GridFsResource with a GridFsFile. I thought this would also provide a valid GridFsResource, but as i looked into it seems that the inputStream is missing. I will have a look. Thx for your feedback!\r\n\r\n","created_at":"2018-07-06T09:34:18Z","updated_at":"2018-07-06T09:34:18Z","html_url":"https://github.com/spring-projects/spring-data-mongodb/pull/582#discussion_r200600470","pull_request_url":"https://api.github.com/repos/spring-projects/spring-data-mongodb/pulls/582","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/spring-projects/spring-data-mongodb/pulls/comments/200600470"},"html":{"href":"https://github.com/spring-projects/spring-data-mongodb/pull/582#discussion_r200600470"},"pull_request":{"href":"https://api.github.com/repos/spring-projects/spring-data-mongodb/pulls/582"}},"in_reply_to_id":200588578},"pull_request":{"url":"https://api.github.com/repos/spring-projects/spring-data-mongodb/pulls/582","id":199678701,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk5Njc4NzAx","html_url":"https://github.com/spring-projects/spring-data-mongodb/pull/582","diff_url":"https://github.com/spring-projects/spring-data-mongodb/pull/582.diff","patch_url":"https://github.com/spring-projects/spring-data-mongodb/pull/582.patch","issue_url":"https://api.github.com/repos/spring-projects/spring-data-mongodb/issues/582","number":582,"state":"open","locked":false,"title":"DATAMONGO-2022 - Refactor getResources(String locationPattern) for a …","user":{"login":"nhh","id":13472382,"node_id":"MDQ6VXNlcjEzNDcyMzgy","avatar_url":"https://avatars0.githubusercontent.com/u/13472382?v=4","gravatar_id":"","url":"https://api.github.com/users/nhh","html_url":"https://github.com/nhh","followers_url":"https://api.github.com/users/nhh/followers","following_url":"https://api.github.com/users/nhh/following{/other_user}","gists_url":"https://api.github.com/users/nhh/gists{/gist_id}","starred_url":"https://api.github.com/users/nhh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nhh/subscriptions","organizations_url":"https://api.github.com/users/nhh/orgs","repos_url":"https://api.github.com/users/nhh/repos","events_url":"https://api.github.com/users/nhh/events{/privacy}","received_events_url":"https://api.github.com/users/nhh/received_events","type":"User","site_admin":false},"body":"…more readable approach\r\n\r\nThe solution should be more readable, avoid using multiple additional dependencies\r\nand decrease variable instantiation.\r\n\r\n<!--\r\n\r\nThank you for proposing a pull request. This template will guide you through the essential steps necessary for a pull request.\r\nMake sure that:\r\n\r\n-->\r\n\r\n- [x] You have read the [Spring Data contribution guidelines](https://github.com/spring-projects/spring-data-build/blob/master/CONTRIBUTING.adoc).\r\n- [x] There is a ticket in the bug tracker for the project in our [JIRA](https://jira.spring.io/browse/DATAMONGO).\r\n- [x] You use the code formatters provided [here](https://github.com/spring-projects/spring-data-build/tree/master/etc/ide) and have them applied to your changes. Don’t submit any formatting related changes.\r\n- [ ] You submit test cases (unit or integration tests) that back your changes.\r\n- [x] You added yourself as author in the headers of the classes you touched. Amend the date range in the Apache license header if needed. For new types, add the license header (copy from another file and set the current year only).\r\n","created_at":"2018-07-06T08:29:17Z","updated_at":"2018-07-06T09:34:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ae525a811dfe54465f155f815f524c16cf7d3e07","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/spring-projects/spring-data-mongodb/pulls/582/commits","review_comments_url":"https://api.github.com/repos/spring-projects/spring-data-mongodb/pulls/582/comments","review_comment_url":"https://api.github.com/repos/spring-projects/spring-data-mongodb/pulls/comments{/number}","comments_url":"https://api.github.com/repos/spring-projects/spring-data-mongodb/issues/582/comments","statuses_url":"https://api.github.com/repos/spring-projects/spring-data-mongodb/statuses/68b907503c78b3aba1d1916938ca500fd143267a","head":{"label":"nhh:DATAMONGO-2022","ref":"DATAMONGO-2022","sha":"68b907503c78b3aba1d1916938ca500fd143267a","user":{"login":"nhh","id":13472382,"node_id":"MDQ6VXNlcjEzNDcyMzgy","avatar_url":"https://avatars0.githubusercontent.com/u/13472382?v=4","gravatar_id":"","url":"https://api.github.com/users/nhh","html_url":"https://github.com/nhh","followers_url":"https://api.github.com/users/nhh/followers","following_url":"https://api.github.com/users/nhh/following{/other_user}","gists_url":"https://api.github.com/users/nhh/gists{/gist_id}","starred_url":"https://api.github.com/users/nhh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nhh/subscriptions","organizations_url":"https://api.github.com/users/nhh/orgs","repos_url":"https://api.github.com/users/nhh/repos","events_url":"https://api.github.com/users/nhh/events{/privacy}","received_events_url":"https://api.github.com/users/nhh/received_events","type":"User","site_admin":false},"repo":{"id":139868320,"node_id":"MDEwOlJlcG9zaXRvcnkxMzk4NjgzMjA=","name":"spring-data-mongodb","full_name":"nhh/spring-data-mongodb","owner":{"login":"nhh","id":13472382,"node_id":"MDQ6VXNlcjEzNDcyMzgy","avatar_url":"https://avatars0.githubusercontent.com/u/13472382?v=4","gravatar_id":"","url":"https://api.github.com/users/nhh","html_url":"https://github.com/nhh","followers_url":"https://api.github.com/users/nhh/followers","following_url":"https://api.github.com/users/nhh/following{/other_user}","gists_url":"https://api.github.com/users/nhh/gists{/gist_id}","starred_url":"https://api.github.com/users/nhh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nhh/subscriptions","organizations_url":"https://api.github.com/users/nhh/orgs","repos_url":"https://api.github.com/users/nhh/repos","events_url":"https://api.github.com/users/nhh/events{/privacy}","received_events_url":"https://api.github.com/users/nhh/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nhh/spring-data-mongodb","description":"Provide support to increase developer productivity in Java when using MongoDB. Uses familiar Spring concepts such as a template classes for core API usage and lightweight repository style data access.","fork":true,"url":"https://api.github.com/repos/nhh/spring-data-mongodb","forks_url":"https://api.github.com/repos/nhh/spring-data-mongodb/forks","keys_url":"https://api.github.com/repos/nhh/spring-data-mongodb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nhh/spring-data-mongodb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nhh/spring-data-mongodb/teams","hooks_url":"https://api.github.com/repos/nhh/spring-data-mongodb/hooks","issue_events_url":"https://api.github.com/repos/nhh/spring-data-mongodb/issues/events{/number}","events_url":"https://api.github.com/repos/nhh/spring-data-mongodb/events","assignees_url":"https://api.github.com/repos/nhh/spring-data-mongodb/assignees{/user}","branches_url":"https://api.github.com/repos/nhh/spring-data-mongodb/branches{/branch}","tags_url":"https://api.github.com/repos/nhh/spring-data-mongodb/tags","blobs_url":"https://api.github.com/repos/nhh/spring-data-mongodb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nhh/spring-data-mongodb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nhh/spring-data-mongodb/git/refs{/sha}","trees_url":"https://api.github.com/repos/nhh/spring-data-mongodb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nhh/spring-data-mongodb/statuses/{sha}","languages_url":"https://api.github.com/repos/nhh/spring-data-mongodb/languages","stargazers_url":"https://api.github.com/repos/nhh/spring-data-mongodb/stargazers","contributors_url":"https://api.github.com/repos/nhh/spring-data-mongodb/contributors","subscribers_url":"https://api.github.com/repos/nhh/spring-data-mongodb/subscribers","subscription_url":"https://api.github.com/repos/nhh/spring-data-mongodb/subscription","commits_url":"https://api.github.com/repos/nhh/spring-data-mongodb/commits{/sha}","git_commits_url":"https://api.github.com/repos/nhh/spring-data-mongodb/git/commits{/sha}","comments_url":"https://api.github.com/repos/nhh/spring-data-mongodb/comments{/number}","issue_comment_url":"https://api.github.com/repos/nhh/spring-data-mongodb/issues/comments{/number}","contents_url":"https://api.github.com/repos/nhh/spring-data-mongodb/contents/{+path}","compare_url":"https://api.github.com/repos/nhh/spring-data-mongodb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nhh/spring-data-mongodb/merges","archive_url":"https://api.github.com/repos/nhh/spring-data-mongodb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nhh/spring-data-mongodb/downloads","issues_url":"https://api.github.com/repos/nhh/spring-data-mongodb/issues{/number}","pulls_url":"https://api.github.com/repos/nhh/spring-data-mongodb/pulls{/number}","milestones_url":"https://api.github.com/repos/nhh/spring-data-mongodb/milestones{/number}","notifications_url":"https://api.github.com/repos/nhh/spring-data-mongodb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nhh/spring-data-mongodb/labels{/name}","releases_url":"https://api.github.com/repos/nhh/spring-data-mongodb/releases{/id}","deployments_url":"https://api.github.com/repos/nhh/spring-data-mongodb/deployments","created_at":"2018-07-05T15:27:17Z","updated_at":"2018-07-05T15:27:23Z","pushed_at":"2018-07-06T08:28:18Z","git_url":"git://github.com/nhh/spring-data-mongodb.git","ssh_url":"git@github.com:nhh/spring-data-mongodb.git","clone_url":"https://github.com/nhh/spring-data-mongodb.git","svn_url":"https://github.com/nhh/spring-data-mongodb","homepage":"http://projects.spring.io/spring-data-mongodb/","size":15773,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"spring-projects:master","ref":"master","sha":"46ed58b465ebe69577a7955ed82205cbeb983d99","user":{"login":"spring-projects","id":317776,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMxNzc3Ng==","avatar_url":"https://avatars0.githubusercontent.com/u/317776?v=4","gravatar_id":"","url":"https://api.github.com/users/spring-projects","html_url":"https://github.com/spring-projects","followers_url":"https://api.github.com/users/spring-projects/followers","following_url":"https://api.github.com/users/spring-projects/following{/other_user}","gists_url":"https://api.github.com/users/spring-projects/gists{/gist_id}","starred_url":"https://api.github.com/users/spring-projects/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spring-projects/subscriptions","organizations_url":"https://api.github.com/users/spring-projects/orgs","repos_url":"https://api.github.com/users/spring-projects/repos","events_url":"https://api.github.com/users/spring-projects/events{/privacy}","received_events_url":"https://api.github.com/users/spring-projects/received_events","type":"Organization","site_admin":false},"repo":{"id":2566570,"node_id":"MDEwOlJlcG9zaXRvcnkyNTY2NTcw","name":"spring-data-mongodb","full_name":"spring-projects/spring-data-mongodb","owner":{"login":"spring-projects","id":317776,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMxNzc3Ng==","avatar_url":"https://avatars0.githubusercontent.com/u/317776?v=4","gravatar_id":"","url":"https://api.github.com/users/spring-projects","html_url":"https://github.com/spring-projects","followers_url":"https://api.github.com/users/spring-projects/followers","following_url":"https://api.github.com/users/spring-projects/following{/other_user}","gists_url":"https://api.github.com/users/spring-projects/gists{/gist_id}","starred_url":"https://api.github.com/users/spring-projects/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spring-projects/subscriptions","organizations_url":"https://api.github.com/users/spring-projects/orgs","repos_url":"https://api.github.com/users/spring-projects/repos","events_url":"https://api.github.com/users/spring-projects/events{/privacy}","received_events_url":"https://api.github.com/users/spring-projects/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/spring-projects/spring-data-mongodb","description":"Provide support to increase developer productivity in Java when using MongoDB. Uses familiar Spring concepts such as a template classes for core API usage and lightweight repository style data access.","fork":false,"url":"https://api.github.com/repos/spring-projects/spring-data-mongodb","forks_url":"https://api.github.com/repos/spring-projects/spring-data-mongodb/forks","keys_url":"https://api.github.com/repos/spring-projects/spring-data-mongodb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/spring-projects/spring-data-mongodb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/spring-projects/spring-data-mongodb/teams","hooks_url":"https://api.github.com/repos/spring-projects/spring-data-mongodb/hooks","issue_events_url":"https://api.github.com/repos/spring-projects/spring-data-mongodb/issues/events{/number}","events_url":"https://api.github.com/repos/spring-projects/spring-data-mongodb/events","assignees_url":"https://api.github.com/repos/spring-projects/spring-data-mongodb/assignees{/user}","branches_url":"https://api.github.com/repos/spring-projects/spring-data-mongodb/branches{/branch}","tags_url":"https://api.github.com/repos/spring-projects/spring-data-mongodb/tags","blobs_url":"https://api.github.com/repos/spring-projects/spring-data-mongodb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/spring-projects/spring-data-mongodb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/spring-projects/spring-data-mongodb/git/refs{/sha}","trees_url":"https://api.github.com/repos/spring-projects/spring-data-mongodb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/spring-projects/spring-data-mongodb/statuses/{sha}","languages_url":"https://api.github.com/repos/spring-projects/spring-data-mongodb/languages","stargazers_url":"https://api.github.com/repos/spring-projects/spring-data-mongodb/stargazers","contributors_url":"https://api.github.com/repos/spring-projects/spring-data-mongodb/contributors","subscribers_url":"https://api.github.com/repos/spring-projects/spring-data-mongodb/subscribers","subscription_url":"https://api.github.com/repos/spring-projects/spring-data-mongodb/subscription","commits_url":"https://api.github.com/repos/spring-projects/spring-data-mongodb/commits{/sha}","git_commits_url":"https://api.github.com/repos/spring-projects/spring-data-mongodb/git/commits{/sha}","comments_url":"https://api.github.com/repos/spring-projects/spring-data-mongodb/comments{/number}","issue_comment_url":"https://api.github.com/repos/spring-projects/spring-data-mongodb/issues/comments{/number}","contents_url":"https://api.github.com/repos/spring-projects/spring-data-mongodb/contents/{+path}","compare_url":"https://api.github.com/repos/spring-projects/spring-data-mongodb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/spring-projects/spring-data-mongodb/merges","archive_url":"https://api.github.com/repos/spring-projects/spring-data-mongodb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/spring-projects/spring-data-mongodb/downloads","issues_url":"https://api.github.com/repos/spring-projects/spring-data-mongodb/issues{/number}","pulls_url":"https://api.github.com/repos/spring-projects/spring-data-mongodb/pulls{/number}","milestones_url":"https://api.github.com/repos/spring-projects/spring-data-mongodb/milestones{/number}","notifications_url":"https://api.github.com/repos/spring-projects/spring-data-mongodb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/spring-projects/spring-data-mongodb/labels{/name}","releases_url":"https://api.github.com/repos/spring-projects/spring-data-mongodb/releases{/id}","deployments_url":"https://api.github.com/repos/spring-projects/spring-data-mongodb/deployments","created_at":"2011-10-13T01:06:55Z","updated_at":"2018-07-06T06:03:35Z","pushed_at":"2018-07-06T08:29:18Z","git_url":"git://github.com/spring-projects/spring-data-mongodb.git","ssh_url":"git@github.com:spring-projects/spring-data-mongodb.git","clone_url":"https://github.com/spring-projects/spring-data-mongodb.git","svn_url":"https://github.com/spring-projects/spring-data-mongodb","homepage":"http://projects.spring.io/spring-data-mongodb/","size":15816,"stargazers_count":875,"watchers_count":875,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":688,"mirror_url":null,"archived":false,"open_issues_count":28,"license":null,"forks":688,"open_issues":28,"watchers":875,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/spring-projects/spring-data-mongodb/pulls/582"},"html":{"href":"https://github.com/spring-projects/spring-data-mongodb/pull/582"},"issue":{"href":"https://api.github.com/repos/spring-projects/spring-data-mongodb/issues/582"},"comments":{"href":"https://api.github.com/repos/spring-projects/spring-data-mongodb/issues/582/comments"},"review_comments":{"href":"https://api.github.com/repos/spring-projects/spring-data-mongodb/pulls/582/comments"},"review_comment":{"href":"https://api.github.com/repos/spring-projects/spring-data-mongodb/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/spring-projects/spring-data-mongodb/pulls/582/commits"},"statuses":{"href":"https://api.github.com/repos/spring-projects/spring-data-mongodb/statuses/68b907503c78b3aba1d1916938ca500fd143267a"}},"author_association":"NONE"}}
{"actor":{"display_login":"nhanft"}}