cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ian Clelland (JIRA)" <>
Subject [jira] [Commented] (CB-7375) Investigate breaking changes at file plugin
Date Tue, 26 Aug 2014 13:37:58 GMT


Ian Clelland commented on CB-7375:

To make this work for both Android/iOS *and* WP8, we can do this:

When JavaScript code is expecting an Entry structure to be returned from an exec() call, the
structure returned should include these fields:

    isFile: Boolean
    isDirectory: Boolean

    name: String name of the file
    fullPath: String path to this file, relative to the filesystem root
    nativeURL: [Optional] String URL to this file that can be used natively by the webview
(Important for <video src> attributes on Android)

    filesystemName: [Optional] String name of filesystem, eg "persistent", "temporary", "cache"
    filesystem: [Optional] Actual FileSystem object in which this file can be found

Only one of {{filesystemName}} or {{filesystem}} should be provided. If {{filesystemName}}
is provided, then the JavaScript should construct an appropriate {{FileSystem}} object. If
no {{filesystemName}} is provided, but {{filesystem}} is, then {{filesystem}} should be used
as the {{FileSystem}} object for the new {{Entry}}.

I suggest that filesystemName, if provided, should take precedence, since it is not part of
the standard, and that makes it more difficult to include it accidentally in the exec response.

Then to build a filesystem object for an Entry object, the code would look like this:

// Set a default
var filesystem = <some default filesystem to use>;
// Find an explicit name, if one was provided
var newFSName = entry.filesystemName || (entry.filesystem &&;
// Use the name *or* the provided FS *or* the default fs
var fs = (newFSName && new FileSystem(newFSName, { name: "", fullPath: "/" })) ||
entry.filesystem || filesystem;

> Investigate breaking changes at file plugin
> -------------------------------------------
>                 Key: CB-7375
>                 URL:
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Plugin File
>    Affects Versions: 3.5.0
>            Reporter: Martin Gonzalez
>            Assignee: Ian Clelland
>              Labels: file
>             Fix For: 3.6.0
> Some of the changes made lately to file plugin with this commit:;a=commit;h=0ffb96988c0539222887f7756a653e7f0a1ed12c
> Are breaking changes to this plugin, affecting other platforms as android.
> Running mobile spec after that specific commit, 4 file tests are failing (test 125 -128).

This message was sent by Atlassian JIRA

View raw message