cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jasongin <>
Subject [GitHub] cordova-plugin-file pull request: CB-10577: Android resolveLocalFi...
Date Fri, 04 Mar 2016 22:21:22 GMT
GitHub user jasongin opened a pull request:

    CB-10577: Android resolveLocalFileSystemURL should detect directory

    @rakatyal or @riknoll please review
    There were two places in the Android file plugin code that didn't do the right thing when
resolving a URI whose trailing slash didn't match the directory vs file status.
    1. In LocalFileSystem.toLocalUri(), the returned path should never have a terminating
slash if the path does not point to a directory.
    2. In FileUtils.resolveLocalFileSystemUri(), resolving a cdvfile:// (aka "local") URI
now converts to native URI and back to a local URI (making use of the change above) in order
to force resolution of whether the path points to a file or a directory and fix the terminating
slash character accordingly. This is only done for local URIs, because for native URIs the
resolveNativeUri() call would already have called toLocalUri() so doing it again would be
redundant in that case.
    I added automated test cases for resolving native URI files and directories using mismatched
trailing slashes. As for cdvfile:// URIs, we currently only have manual test cases for those
(at the bottom of tests.js) and they aren't very thorough. I manually tested this fix with
cdvfile:// URIs.

You can merge this pull request into a Git repository by running:

    $ git pull CB-10577

Alternatively you can review and apply these changes as the patch at:

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #167
commit 89ccaf2d4c3b2ffbdbdc79804238c083ce9f2c30
Author: Jason Ginchereau <>
Date:   2016-03-04T20:02:10Z

    CB-10577: Android resolveLocalFileSystemURL should detect directory vs file


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.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message