Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-9752

getDirectory fails on valid directory with assets filesystem

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • None
    • None
    • cordova 5.3.3
      cordova android 4.0.0
      cordova-plugin-file 2.0.0

          • using build-extras.gradle to speed up lookups (as per README.md for plugin) ***

    Description

      The following JS snippet fails with "failed to get www directory":

      window.resolveLocalFileSystemURL(cordova.file.applicationDirectory, function(appDir) {
      appDir.getDirectory('www',

      {create:false}

      , function(wwwDir)

      { console.log("success!"); }

      , function()

      { console.log("failed to get www directory"); }

      );
      }, function() {
      console.log("Failed to get application directory");
      });

      I narrowed it down to AssetFilesystem.java's listAssets() method called from isDirectory() which returns the "new String[0];" (assetPath = 'www/' in this method) which in turn causes isDirectory() to return false.

      Attachments

        Activity

          People

            jasongin Jason Ginchereau
            denisbabineau Denis Babineau
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: