{"action":"created","comment":{"url":"https://api.github.com/repos/apache/camel/pulls/comments/89345085","pull_request_review_id":9890601,"id":89345085,"diff_hunk":"@@ -257,58 +235,65 @@ public DropboxResult move(String remotePath, String newRemotePath) throws Dropbo\n      * @return a DropboxResult object with the content (ByteArrayOutputStream) of every files inside the remote path.\n      * @throws DropboxException\n      */\n-    public DropboxResult get(String remotePath) throws DropboxException {\n-        DropboxResult result = new DropboxFileDownloadResult();\n-        //a map representing for each path the result of the baos\n-        Map<String, ByteArrayOutputStream> resultEntries = new HashMap<String, ByteArrayOutputStream>();\n-        //iterate from the remotePath\n-        downloadFilesInFolder(remotePath, resultEntries);\n-        //put the map of baos as result\n-        result.setResultEntries(resultEntries);\n-        return result;\n+    public DropboxFileDownloadResult get(String remotePath) throws DropboxException {\n+        return new DropboxFileDownloadResult(downloadFilesInFolder(remotePath));\n     }\n \n-    private void downloadFilesInFolder(String path, Map<String, ByteArrayOutputStream> resultEntries) throws DropboxException {\n-        DbxEntry.WithChildren listing = null;\n+\n+    public boolean isDirectory(String path) throws DropboxException {\n         try {\n-            listing = DropboxAPIFacade.client.getMetadataWithChildren(path);\n+            DbxEntry.WithChildren listing = client.getMetadataWithChildren(path);\n+            return listing.children != null;\n         } catch (DbxException e) {\n             throw new DropboxException(path + \" does not exist or can't obtain metadata\");\n         }\n-        if (listing.children == null) {\n-            LOG.info(\"downloading a single file...\");\n-            downloadSingleFile(path, resultEntries);\n-            return;\n-        }\n-        for (DbxEntry entry : listing.children) {\n-            if (entry.isFile()) {\n-                try {\n-                    //get the baos of the file\n-                    downloadSingleFile(entry.path, resultEntries);\n-                } catch (DropboxException e) {\n-                    LOG.warn(\"can't download from \" + entry.path);\n+    }\n+\n+\n+    private Map<String, Object> downloadFilesInFolder(String path) throws DropboxException {\n+        try {\n+            DbxEntry.WithChildren listing = client.getMetadataWithChildren(path);\n+            if (listing == null) {\n+                return Collections.emptyMap();\n+            } else if (listing.children == null) {\n+                LOG.info(\"downloading a single file...\");","path":"components/camel-dropbox/src/main/java/org/apache/camel/component/dropbox/core/DropboxAPIFacade.java","position":284,"original_position":284,"commit_id":"1ac48d5539d17fe38d30d7cee3dff4c4401c61eb","original_commit_id":"1ac48d5539d17fe38d30d7cee3dff4c4401c61eb","user":{"login":"davsclaus","id":477100,"avatar_url":"https://avatars.githubusercontent.com/u/477100?v=3","gravatar_id":"","url":"https://api.github.com/users/davsclaus","html_url":"https://github.com/davsclaus","followers_url":"https://api.github.com/users/davsclaus/followers","following_url":"https://api.github.com/users/davsclaus/following{/other_user}","gists_url":"https://api.github.com/users/davsclaus/gists{/gist_id}","starred_url":"https://api.github.com/users/davsclaus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davsclaus/subscriptions","organizations_url":"https://api.github.com/users/davsclaus/orgs","repos_url":"https://api.github.com/users/davsclaus/repos","events_url":"https://api.github.com/users/davsclaus/events{/privacy}","received_events_url":"https://api.github.com/users/davsclaus/received_events","type":"User","site_admin":false},"body":"This should maybe be DEBUG logging level to reduce logging noise","created_at":"2016-11-23T15:57:45Z","updated_at":"2016-11-23T16:00:56Z","html_url":"https://github.com/apache/camel/pull/1298#discussion_r89345085","pull_request_url":"https://api.github.com/repos/apache/camel/pulls/1298","_links":{"self":{"href":"https://api.github.com/repos/apache/camel/pulls/comments/89345085"},"html":{"href":"https://github.com/apache/camel/pull/1298#discussion_r89345085"},"pull_request":{"href":"https://api.github.com/repos/apache/camel/pulls/1298"}}},"pull_request":{"url":"https://api.github.com/repos/apache/camel/pulls/1298","id":94988631,"html_url":"https://github.com/apache/camel/pull/1298","diff_url":"https://github.com/apache/camel/pull/1298.diff","patch_url":"https://github.com/apache/camel/pull/1298.patch","issue_url":"https://api.github.com/repos/apache/camel/issues/1298","number":1298,"state":"open","locked":false,"title":"CAMEL-10466  - fix/dropbox oom","user":{"login":"ecausarano","id":507032,"avatar_url":"https://avatars.githubusercontent.com/u/507032?v=3","gravatar_id":"","url":"https://api.github.com/users/ecausarano","html_url":"https://github.com/ecausarano","followers_url":"https://api.github.com/users/ecausarano/followers","following_url":"https://api.github.com/users/ecausarano/following{/other_user}","gists_url":"https://api.github.com/users/ecausarano/gists{/gist_id}","starred_url":"https://api.github.com/users/ecausarano/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ecausarano/subscriptions","organizations_url":"https://api.github.com/users/ecausarano/orgs","repos_url":"https://api.github.com/users/ecausarano/repos","events_url":"https://api.github.com/users/ecausarano/events{/privacy}","received_events_url":"https://api.github.com/users/ecausarano/received_events","type":"User","site_admin":false},"body":"See CAMEL-10466 - In a nutshell: I've changed the DropboxAPIFacade to use an OutputStreamBuilder rather than a BAOS. All other changes are corollary to this.\r\n\r\nI'm still missing some questions about testing, returning empty content etc... (see discussion in JIRA)","created_at":"2016-11-23T11:51:01Z","updated_at":"2016-11-23T16:00:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d6d3a7359a502a30b9308ee63ca116591b1fefda","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/apache/camel/pulls/1298/commits","review_comments_url":"https://api.github.com/repos/apache/camel/pulls/1298/comments","review_comment_url":"https://api.github.com/repos/apache/camel/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/camel/issues/1298/comments","statuses_url":"https://api.github.com/repos/apache/camel/statuses/1ac48d5539d17fe38d30d7cee3dff4c4401c61eb","head":{"label":"ecausarano:fix/dropbox-oom","ref":"fix/dropbox-oom","sha":"1ac48d5539d17fe38d30d7cee3dff4c4401c61eb","user":{"login":"ecausarano","id":507032,"avatar_url":"https://avatars.githubusercontent.com/u/507032?v=3","gravatar_id":"","url":"https://api.github.com/users/ecausarano","html_url":"https://github.com/ecausarano","followers_url":"https://api.github.com/users/ecausarano/followers","following_url":"https://api.github.com/users/ecausarano/following{/other_user}","gists_url":"https://api.github.com/users/ecausarano/gists{/gist_id}","starred_url":"https://api.github.com/users/ecausarano/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ecausarano/subscriptions","organizations_url":"https://api.github.com/users/ecausarano/orgs","repos_url":"https://api.github.com/users/ecausarano/repos","events_url":"https://api.github.com/users/ecausarano/events{/privacy}","received_events_url":"https://api.github.com/users/ecausarano/received_events","type":"User","site_admin":false},"repo":{"id":74042437,"name":"camel","full_name":"ecausarano/camel","owner":{"login":"ecausarano","id":507032,"avatar_url":"https://avatars.githubusercontent.com/u/507032?v=3","gravatar_id":"","url":"https://api.github.com/users/ecausarano","html_url":"https://github.com/ecausarano","followers_url":"https://api.github.com/users/ecausarano/followers","following_url":"https://api.github.com/users/ecausarano/following{/other_user}","gists_url":"https://api.github.com/users/ecausarano/gists{/gist_id}","starred_url":"https://api.github.com/users/ecausarano/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ecausarano/subscriptions","organizations_url":"https://api.github.com/users/ecausarano/orgs","repos_url":"https://api.github.com/users/ecausarano/repos","events_url":"https://api.github.com/users/ecausarano/events{/privacy}","received_events_url":"https://api.github.com/users/ecausarano/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ecausarano/camel","description":"Mirror of Apache Camel","fork":true,"url":"https://api.github.com/repos/ecausarano/camel","forks_url":"https://api.github.com/repos/ecausarano/camel/forks","keys_url":"https://api.github.com/repos/ecausarano/camel/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ecausarano/camel/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ecausarano/camel/teams","hooks_url":"https://api.github.com/repos/ecausarano/camel/hooks","issue_events_url":"https://api.github.com/repos/ecausarano/camel/issues/events{/number}","events_url":"https://api.github.com/repos/ecausarano/camel/events","assignees_url":"https://api.github.com/repos/ecausarano/camel/assignees{/user}","branches_url":"https://api.github.com/repos/ecausarano/camel/branches{/branch}","tags_url":"https://api.github.com/repos/ecausarano/camel/tags","blobs_url":"https://api.github.com/repos/ecausarano/camel/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ecausarano/camel/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ecausarano/camel/git/refs{/sha}","trees_url":"https://api.github.com/repos/ecausarano/camel/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ecausarano/camel/statuses/{sha}","languages_url":"https://api.github.com/repos/ecausarano/camel/languages","stargazers_url":"https://api.github.com/repos/ecausarano/camel/stargazers","contributors_url":"https://api.github.com/repos/ecausarano/camel/contributors","subscribers_url":"https://api.github.com/repos/ecausarano/camel/subscribers","subscription_url":"https://api.github.com/repos/ecausarano/camel/subscription","commits_url":"https://api.github.com/repos/ecausarano/camel/commits{/sha}","git_commits_url":"https://api.github.com/repos/ecausarano/camel/git/commits{/sha}","comments_url":"https://api.github.com/repos/ecausarano/camel/comments{/number}","issue_comment_url":"https://api.github.com/repos/ecausarano/camel/issues/comments{/number}","contents_url":"https://api.github.com/repos/ecausarano/camel/contents/{+path}","compare_url":"https://api.github.com/repos/ecausarano/camel/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ecausarano/camel/merges","archive_url":"https://api.github.com/repos/ecausarano/camel/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ecausarano/camel/downloads","issues_url":"https://api.github.com/repos/ecausarano/camel/issues{/number}","pulls_url":"https://api.github.com/repos/ecausarano/camel/pulls{/number}","milestones_url":"https://api.github.com/repos/ecausarano/camel/milestones{/number}","notifications_url":"https://api.github.com/repos/ecausarano/camel/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ecausarano/camel/labels{/name}","releases_url":"https://api.github.com/repos/ecausarano/camel/releases{/id}","deployments_url":"https://api.github.com/repos/ecausarano/camel/deployments","created_at":"2016-11-17T15:52:50Z","updated_at":"2016-11-17T15:53:40Z","pushed_at":"2016-11-23T13:38:51Z","git_url":"git://github.com/ecausarano/camel.git","ssh_url":"git@github.com:ecausarano/camel.git","clone_url":"https://github.com/ecausarano/camel.git","svn_url":"https://github.com/ecausarano/camel","homepage":null,"size":143666,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"apache:master","ref":"master","sha":"a37b24de01744280dea902e6c973a7a535140ba4","user":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"repo":{"id":206317,"name":"camel","full_name":"apache/camel","owner":{"login":"apache","id":47359,"avatar_url":"https://avatars.githubusercontent.com/u/47359?v=3","gravatar_id":"","url":"https://api.github.com/users/apache","html_url":"https://github.com/apache","followers_url":"https://api.github.com/users/apache/followers","following_url":"https://api.github.com/users/apache/following{/other_user}","gists_url":"https://api.github.com/users/apache/gists{/gist_id}","starred_url":"https://api.github.com/users/apache/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apache/subscriptions","organizations_url":"https://api.github.com/users/apache/orgs","repos_url":"https://api.github.com/users/apache/repos","events_url":"https://api.github.com/users/apache/events{/privacy}","received_events_url":"https://api.github.com/users/apache/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/apache/camel","description":"Mirror of Apache Camel","fork":false,"url":"https://api.github.com/repos/apache/camel","forks_url":"https://api.github.com/repos/apache/camel/forks","keys_url":"https://api.github.com/repos/apache/camel/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/camel/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/camel/teams","hooks_url":"https://api.github.com/repos/apache/camel/hooks","issue_events_url":"https://api.github.com/repos/apache/camel/issues/events{/number}","events_url":"https://api.github.com/repos/apache/camel/events","assignees_url":"https://api.github.com/repos/apache/camel/assignees{/user}","branches_url":"https://api.github.com/repos/apache/camel/branches{/branch}","tags_url":"https://api.github.com/repos/apache/camel/tags","blobs_url":"https://api.github.com/repos/apache/camel/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/camel/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/camel/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/camel/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/camel/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/camel/languages","stargazers_url":"https://api.github.com/repos/apache/camel/stargazers","contributors_url":"https://api.github.com/repos/apache/camel/contributors","subscribers_url":"https://api.github.com/repos/apache/camel/subscribers","subscription_url":"https://api.github.com/repos/apache/camel/subscription","commits_url":"https://api.github.com/repos/apache/camel/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/camel/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/camel/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/camel/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/camel/contents/{+path}","compare_url":"https://api.github.com/repos/apache/camel/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/camel/merges","archive_url":"https://api.github.com/repos/apache/camel/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/camel/downloads","issues_url":"https://api.github.com/repos/apache/camel/issues{/number}","pulls_url":"https://api.github.com/repos/apache/camel/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/camel/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/camel/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/camel/labels{/name}","releases_url":"https://api.github.com/repos/apache/camel/releases{/id}","deployments_url":"https://api.github.com/repos/apache/camel/deployments","created_at":"2009-05-21T00:25:36Z","updated_at":"2016-11-23T09:58:56Z","pushed_at":"2016-11-23T15:52:25Z","git_url":"git://github.com/apache/camel.git","ssh_url":"git@github.com:apache/camel.git","clone_url":"https://github.com/apache/camel.git","svn_url":"https://github.com/apache/camel","homepage":null,"size":163916,"stargazers_count":1074,"watchers_count":1074,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1504,"mirror_url":"git://git.apache.org/camel.git","open_issues_count":17,"forks":1504,"open_issues":17,"watchers":1074,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/camel/pulls/1298"},"html":{"href":"https://github.com/apache/camel/pull/1298"},"issue":{"href":"https://api.github.com/repos/apache/camel/issues/1298"},"comments":{"href":"https://api.github.com/repos/apache/camel/issues/1298/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/camel/pulls/1298/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/camel/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/camel/pulls/1298/commits"},"statuses":{"href":"https://api.github.com/repos/apache/camel/statuses/1ac48d5539d17fe38d30d7cee3dff4c4401c61eb"}}}}
{"actor":{"display_login":"davsclaus"}}