{"action":"created","comment":{"url":"https://api.github.com/repos/apache/cordova-plugin-file/pulls/comments/56607030","id":56607030,"diff_hunk":"@@ -1124,7 +1171,18 @@ public void run(JSONArray args) throws FileExistsException, IOException, TypeMis\n                     }\n                 }, lastRawArgs, callback);\n                 break;\n-            case WRITE_PERM:\n+            case PERM_DIR:\n+                threadhelper( new FileOp( ){\n+                    public void run(JSONArray args) throws FileExistsException, IOException, TypeMismatchException, EncodingException, JSONException {\n+                        String dirname = args.getString(0);\n+\n+                        String path = args.getString(1);\n+                        JSONObject obj = getFile(dirname, path, args.optJSONObject(2), true);\n+                        callback.success(obj);\n+                    }\n+                }, lastRawArgs, callback);\n+                break;    \n+            case WRITE_ACTION:","path":"src/android/FileUtils.java","position":184,"original_position":184,"commit_id":"c1e72827695454ec16ccc5c9dee407d95b01b75f","original_commit_id":"c1e72827695454ec16ccc5c9dee407d95b01b75f","user":{"login":"rakatyal","id":12533467,"avatar_url":"https://avatars.githubusercontent.com/u/12533467?v=3","gravatar_id":"","url":"https://api.github.com/users/rakatyal","html_url":"https://github.com/rakatyal","followers_url":"https://api.github.com/users/rakatyal/followers","following_url":"https://api.github.com/users/rakatyal/following{/other_user}","gists_url":"https://api.github.com/users/rakatyal/gists{/gist_id}","starred_url":"https://api.github.com/users/rakatyal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rakatyal/subscriptions","organizations_url":"https://api.github.com/users/rakatyal/orgs","repos_url":"https://api.github.com/users/rakatyal/repos","events_url":"https://api.github.com/users/rakatyal/events{/privacy}","received_events_url":"https://api.github.com/users/rakatyal/received_events","type":"User","site_admin":false},"body":"I like this convention better since this differentiates the calls for 'FILE' and 'DIR'. ","created_at":"2016-03-18T02:38:13Z","updated_at":"2016-03-18T02:38:13Z","html_url":"https://github.com/apache/cordova-plugin-file/pull/170#discussion_r56607030","pull_request_url":"https://api.github.com/repos/apache/cordova-plugin-file/pulls/170","_links":{"self":{"href":"https://api.github.com/repos/apache/cordova-plugin-file/pulls/comments/56607030"},"html":{"href":"https://github.com/apache/cordova-plugin-file/pull/170#discussion_r56607030"},"pull_request":{"href":"https://api.github.com/repos/apache/cordova-plugin-file/pulls/170"}}},"pull_request":{"url":"https://api.github.com/repos/apache/cordova-plugin-file/pulls/170","id":62588296,"html_url":"https://github.com/apache/cordova-plugin-file/pull/170","diff_url":"https://github.com/apache/cordova-plugin-file/pull/170.diff","patch_url":"https://github.com/apache/cordova-plugin-file/pull/170.patch","issue_url":"https://api.github.com/repos/apache/cordova-plugin-file/issues/170","number":170,"state":"open","locked":false,"title":"CB-10798, CB-10384: Fixing permissions for Marshmallow","user":{"login":"rakatyal","id":12533467,"avatar_url":"https://avatars.githubusercontent.com/u/12533467?v=3","gravatar_id":"","url":"https://api.github.com/users/rakatyal","html_url":"https://github.com/rakatyal","followers_url":"https://api.github.com/users/rakatyal/followers","following_url":"https://api.github.com/users/rakatyal/following{/other_user}","gists_url":"https://api.github.com/users/rakatyal/gists{/gist_id}","starred_url":"https://api.github.com/users/rakatyal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rakatyal/subscriptions","organizations_url":"https://api.github.com/users/rakatyal/orgs","repos_url":"https://api.github.com/users/rakatyal/repos","events_url":"https://api.github.com/users/rakatyal/events{/privacy}","received_events_url":"https://api.github.com/users/rakatyal/received_events","type":"User","site_admin":false},"body":"The present code used to ask for permissions on Marshmallow even while trying to read/write from the application's own locations. It should only ask for permission while trying to write to external locations. Also, the getDirectory method currently didn't include permission check which caused it to break while trying to create a directory in an external location. We can get the list of allowed read/write directories and make sure the native url in the picture lies among them.","created_at":"2016-03-11T19:11:28Z","updated_at":"2016-03-18T02:38:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ad425c3d98b8a1faf6d1d8b989773cbdb27a7f0b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/apache/cordova-plugin-file/pulls/170/commits","review_comments_url":"https://api.github.com/repos/apache/cordova-plugin-file/pulls/170/comments","review_comment_url":"https://api.github.com/repos/apache/cordova-plugin-file/pulls/comments{/number}","comments_url":"https://api.github.com/repos/apache/cordova-plugin-file/issues/170/comments","statuses_url":"https://api.github.com/repos/apache/cordova-plugin-file/statuses/c1e72827695454ec16ccc5c9dee407d95b01b75f","head":{"label":"MSOpenTech:raghav-permissions","ref":"raghav-permissions","sha":"c1e72827695454ec16ccc5c9dee407d95b01b75f","user":{"login":"MSOpenTech","id":1638184,"avatar_url":"https://avatars.githubusercontent.com/u/1638184?v=3","gravatar_id":"","url":"https://api.github.com/users/MSOpenTech","html_url":"https://github.com/MSOpenTech","followers_url":"https://api.github.com/users/MSOpenTech/followers","following_url":"https://api.github.com/users/MSOpenTech/following{/other_user}","gists_url":"https://api.github.com/users/MSOpenTech/gists{/gist_id}","starred_url":"https://api.github.com/users/MSOpenTech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MSOpenTech/subscriptions","organizations_url":"https://api.github.com/users/MSOpenTech/orgs","repos_url":"https://api.github.com/users/MSOpenTech/repos","events_url":"https://api.github.com/users/MSOpenTech/events{/privacy}","received_events_url":"https://api.github.com/users/MSOpenTech/received_events","type":"Organization","site_admin":false},"repo":{"id":22709516,"name":"cordova-plugin-file","full_name":"MSOpenTech/cordova-plugin-file","owner":{"login":"MSOpenTech","id":1638184,"avatar_url":"https://avatars.githubusercontent.com/u/1638184?v=3","gravatar_id":"","url":"https://api.github.com/users/MSOpenTech","html_url":"https://github.com/MSOpenTech","followers_url":"https://api.github.com/users/MSOpenTech/followers","following_url":"https://api.github.com/users/MSOpenTech/following{/other_user}","gists_url":"https://api.github.com/users/MSOpenTech/gists{/gist_id}","starred_url":"https://api.github.com/users/MSOpenTech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MSOpenTech/subscriptions","organizations_url":"https://api.github.com/users/MSOpenTech/orgs","repos_url":"https://api.github.com/users/MSOpenTech/repos","events_url":"https://api.github.com/users/MSOpenTech/events{/privacy}","received_events_url":"https://api.github.com/users/MSOpenTech/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/MSOpenTech/cordova-plugin-file","description":"Mirror of Apache Cordova Plugin file","fork":true,"url":"https://api.github.com/repos/MSOpenTech/cordova-plugin-file","forks_url":"https://api.github.com/repos/MSOpenTech/cordova-plugin-file/forks","keys_url":"https://api.github.com/repos/MSOpenTech/cordova-plugin-file/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MSOpenTech/cordova-plugin-file/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MSOpenTech/cordova-plugin-file/teams","hooks_url":"https://api.github.com/repos/MSOpenTech/cordova-plugin-file/hooks","issue_events_url":"https://api.github.com/repos/MSOpenTech/cordova-plugin-file/issues/events{/number}","events_url":"https://api.github.com/repos/MSOpenTech/cordova-plugin-file/events","assignees_url":"https://api.github.com/repos/MSOpenTech/cordova-plugin-file/assignees{/user}","branches_url":"https://api.github.com/repos/MSOpenTech/cordova-plugin-file/branches{/branch}","tags_url":"https://api.github.com/repos/MSOpenTech/cordova-plugin-file/tags","blobs_url":"https://api.github.com/repos/MSOpenTech/cordova-plugin-file/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MSOpenTech/cordova-plugin-file/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MSOpenTech/cordova-plugin-file/git/refs{/sha}","trees_url":"https://api.github.com/repos/MSOpenTech/cordova-plugin-file/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MSOpenTech/cordova-plugin-file/statuses/{sha}","languages_url":"https://api.github.com/repos/MSOpenTech/cordova-plugin-file/languages","stargazers_url":"https://api.github.com/repos/MSOpenTech/cordova-plugin-file/stargazers","contributors_url":"https://api.github.com/repos/MSOpenTech/cordova-plugin-file/contributors","subscribers_url":"https://api.github.com/repos/MSOpenTech/cordova-plugin-file/subscribers","subscription_url":"https://api.github.com/repos/MSOpenTech/cordova-plugin-file/subscription","commits_url":"https://api.github.com/repos/MSOpenTech/cordova-plugin-file/commits{/sha}","git_commits_url":"https://api.github.com/repos/MSOpenTech/cordova-plugin-file/git/commits{/sha}","comments_url":"https://api.github.com/repos/MSOpenTech/cordova-plugin-file/comments{/number}","issue_comment_url":"https://api.github.com/repos/MSOpenTech/cordova-plugin-file/issues/comments{/number}","contents_url":"https://api.github.com/repos/MSOpenTech/cordova-plugin-file/contents/{+path}","compare_url":"https://api.github.com/repos/MSOpenTech/cordova-plugin-file/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MSOpenTech/cordova-plugin-file/merges","archive_url":"https://api.github.com/repos/MSOpenTech/cordova-plugin-file/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MSOpenTech/cordova-plugin-file/downloads","issues_url":"https://api.github.com/repos/MSOpenTech/cordova-plugin-file/issues{/number}","pulls_url":"https://api.github.com/repos/MSOpenTech/cordova-plugin-file/pulls{/number}","milestones_url":"https://api.github.com/repos/MSOpenTech/cordova-plugin-file/milestones{/number}","notifications_url":"https://api.github.com/repos/MSOpenTech/cordova-plugin-file/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MSOpenTech/cordova-plugin-file/labels{/name}","releases_url":"https://api.github.com/repos/MSOpenTech/cordova-plugin-file/releases{/id}","deployments_url":"https://api.github.com/repos/MSOpenTech/cordova-plugin-file/deployments","created_at":"2014-08-07T05:21:45Z","updated_at":"2015-04-27T08:50:53Z","pushed_at":"2016-03-17T23:42:28Z","git_url":"git://github.com/MSOpenTech/cordova-plugin-file.git","ssh_url":"git@github.com:MSOpenTech/cordova-plugin-file.git","clone_url":"https://github.com/MSOpenTech/cordova-plugin-file.git","svn_url":"https://github.com/MSOpenTech/cordova-plugin-file","homepage":null,"size":1905,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":0,"forks":2,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"apache:master","ref":"master","sha":"61c0f76f1d2a68f4fd9159fb30a3edcb65849ae1","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":10860599,"name":"cordova-plugin-file","full_name":"apache/cordova-plugin-file","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/cordova-plugin-file","description":"Mirror of Apache Cordova Plugin file","fork":false,"url":"https://api.github.com/repos/apache/cordova-plugin-file","forks_url":"https://api.github.com/repos/apache/cordova-plugin-file/forks","keys_url":"https://api.github.com/repos/apache/cordova-plugin-file/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apache/cordova-plugin-file/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apache/cordova-plugin-file/teams","hooks_url":"https://api.github.com/repos/apache/cordova-plugin-file/hooks","issue_events_url":"https://api.github.com/repos/apache/cordova-plugin-file/issues/events{/number}","events_url":"https://api.github.com/repos/apache/cordova-plugin-file/events","assignees_url":"https://api.github.com/repos/apache/cordova-plugin-file/assignees{/user}","branches_url":"https://api.github.com/repos/apache/cordova-plugin-file/branches{/branch}","tags_url":"https://api.github.com/repos/apache/cordova-plugin-file/tags","blobs_url":"https://api.github.com/repos/apache/cordova-plugin-file/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apache/cordova-plugin-file/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apache/cordova-plugin-file/git/refs{/sha}","trees_url":"https://api.github.com/repos/apache/cordova-plugin-file/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apache/cordova-plugin-file/statuses/{sha}","languages_url":"https://api.github.com/repos/apache/cordova-plugin-file/languages","stargazers_url":"https://api.github.com/repos/apache/cordova-plugin-file/stargazers","contributors_url":"https://api.github.com/repos/apache/cordova-plugin-file/contributors","subscribers_url":"https://api.github.com/repos/apache/cordova-plugin-file/subscribers","subscription_url":"https://api.github.com/repos/apache/cordova-plugin-file/subscription","commits_url":"https://api.github.com/repos/apache/cordova-plugin-file/commits{/sha}","git_commits_url":"https://api.github.com/repos/apache/cordova-plugin-file/git/commits{/sha}","comments_url":"https://api.github.com/repos/apache/cordova-plugin-file/comments{/number}","issue_comment_url":"https://api.github.com/repos/apache/cordova-plugin-file/issues/comments{/number}","contents_url":"https://api.github.com/repos/apache/cordova-plugin-file/contents/{+path}","compare_url":"https://api.github.com/repos/apache/cordova-plugin-file/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apache/cordova-plugin-file/merges","archive_url":"https://api.github.com/repos/apache/cordova-plugin-file/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apache/cordova-plugin-file/downloads","issues_url":"https://api.github.com/repos/apache/cordova-plugin-file/issues{/number}","pulls_url":"https://api.github.com/repos/apache/cordova-plugin-file/pulls{/number}","milestones_url":"https://api.github.com/repos/apache/cordova-plugin-file/milestones{/number}","notifications_url":"https://api.github.com/repos/apache/cordova-plugin-file/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apache/cordova-plugin-file/labels{/name}","releases_url":"https://api.github.com/repos/apache/cordova-plugin-file/releases{/id}","deployments_url":"https://api.github.com/repos/apache/cordova-plugin-file/deployments","created_at":"2013-06-22T07:00:16Z","updated_at":"2016-03-15T10:15:00Z","pushed_at":"2016-03-17T23:42:28Z","git_url":"git://github.com/apache/cordova-plugin-file.git","ssh_url":"git@github.com:apache/cordova-plugin-file.git","clone_url":"https://github.com/apache/cordova-plugin-file.git","svn_url":"https://github.com/apache/cordova-plugin-file","homepage":null,"size":2405,"stargazers_count":263,"watchers_count":263,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":300,"mirror_url":"git://git.apache.org/cordova-plugin-file.git","open_issues_count":18,"forks":300,"open_issues":18,"watchers":263,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/apache/cordova-plugin-file/pulls/170"},"html":{"href":"https://github.com/apache/cordova-plugin-file/pull/170"},"issue":{"href":"https://api.github.com/repos/apache/cordova-plugin-file/issues/170"},"comments":{"href":"https://api.github.com/repos/apache/cordova-plugin-file/issues/170/comments"},"review_comments":{"href":"https://api.github.com/repos/apache/cordova-plugin-file/pulls/170/comments"},"review_comment":{"href":"https://api.github.com/repos/apache/cordova-plugin-file/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/apache/cordova-plugin-file/pulls/170/commits"},"statuses":{"href":"https://api.github.com/repos/apache/cordova-plugin-file/statuses/c1e72827695454ec16ccc5c9dee407d95b01b75f"}}}}