cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dpeacock <>
Subject [GitHub] cordova-plugin-file pull request: CB-7487 [Android] Broadcast file...
Date Wed, 17 Sep 2014 18:05:33 GMT
Github user dpeacock commented on a diff in the pull request:
    --- Diff: src/android/ ---
    @@ -579,6 +582,7 @@ public long writeToFileAtURL(LocalFilesystemURL inputURL, String data,
                 	// Always close the output
    +			broadcastNewFile(inputURL);
    --- End diff --
    I agree with what you are saying here.  By the time we are in writeToFileAtURL it seems
the file already exists, so I tried moving this logic to getFileForLocalURL.  In here I was
checking if the file existed prior to creation, then broadcasting if it was created.  
    The results however were strange.  Though the files would appear, they would sometimes
be 0 bytes in size.  Trying to debug the javascript portion always resulted in 0 byte files.
    I then tried re-testing the broadcast after the write (where it is in this commit) and
it seems to work as expected.  I can't really explain why this occurring, perhaps you have
some insight on this?  If not, I think it's probably best to leave the broadcast after every
write to be safe.

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

View raw message