cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dblotsky <...@git.apache.org>
Subject [GitHub] cordova-plugin-file pull request: CB-10798, CB-10384: Fixing permi...
Date Fri, 11 Mar 2016 22:43:39 GMT
Github user dblotsky commented on a diff in the pull request:

    https://github.com/apache/cordova-plugin-file/pull/170#discussion_r55900124
  
    --- Diff: src/android/FileUtils.java ---
    @@ -435,8 +443,23 @@ else if (action.equals("getDirectory")) {
                     public void run(JSONArray args) throws FileExistsException, IOException,
TypeMismatchException, EncodingException, JSONException {
                         String dirname=args.getString(0);
                         String path=args.getString(1);
    -                    JSONObject obj = getFile(dirname, path, args.optJSONObject(2), true);
    -                    callbackContext.success(obj);
    +                    String nativeURL = resolveLocalFileSystemURI(dirname).getString("nativeURL");
    +                    JSONObject j = requestAllPaths();
    +                    String[] allowedStorageDirectories = {j.getString("applicationStorageDirectory"),
j.getString("externalApplicationStorageDirectory")};
    +                    boolean needReadPermission = true;
    +
    +                    // Ask for the read permission if the native url lies outside the
allowed storage directories
    +                    for(String directory : allowedStorageDirectories) {
    --- End diff --
    
    There is similar code in the above case. Please de-duplicate it.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


Mime
View raw message