Github user clelland commented on a diff in the pull request:

    https://github.com/apache/cordova-plugin-file/pull/81#discussion_r17667021
  
    --- Diff: src/android/LocalFilesystem.java ---
    @@ -589,6 +593,32 @@ public long writeToFileAtURL(LocalFilesystemURL 
inputURL, String data,
     
             return rawData.length;
        }
    +   
    +    /**
    +     * Send broadcast of new file so files appear over MTP
    +     *
    +     * @param inputURL
    +     */
    +   private void broadcastNewFile(LocalFilesystemURL inputURL) {
    +           //Get the activity
    +           Activity activity = this.cordova.getActivity();
    +           
    +           //Get the context
    +           Context context = activity.getApplicationContext();
    +           
    +           //Get file
    +           File file = new File(this.filesystemPathForURL(inputURL));
    +           if (file != null) {
    --- End diff --
    
    What is this comparison for? I'm pretty sure that `new` can't ever return 
`null`. It also doesn't check for file existence; you'd want `file.exists()` 
for that.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to