You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by rodms10 <gi...@git.apache.org> on 2014/07/22 00:38:31 UTC

[GitHub] cordova-plugin-file pull request: [FxOS] Support for resolve URI, ...

GitHub user rodms10 opened a pull request:

    https://github.com/apache/cordova-plugin-file/pull/64

    [FxOS] Support for resolve URI, request all paths and local app directory.

    Updated file plugin in preparation for file-transfer plugin implementation. Main change is support for `resolveLocalFileSystemURL` which is needed for file-transfer. I'm also better isolating the filesystems. We now support 3 data paths:
     * `applicationDirectory` - Uses `xhr` to get local files that are packaged with the app.
     * `dataDirectory` - For persistent app-specific data files.
     * `cacheDirectory` - Cached files that should survive app restarts (Apps should not rely on the OS to delete files in here).
    
    ### Technical info
    
    To figure out which filesystem to use, file plugin calls the `__format__` function defined in `www/firefoxos/FileSystem.js`, where you have a chance to alter the path sent to the plugin. Over there we add the filesystem name to the full path. Later, the function `resolveToFullPath_` will get a modified full path and return the storage path to be used in indexeddb, the full path of the entry and the file name.
    
    @zalun, can you take a look?

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

    $ git pull https://github.com/rodms10/cordova-plugin-file resolveurl

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

    https://github.com/apache/cordova-plugin-file/pull/64.patch

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

    This closes #64
    
----
commit b33b6fdb581249d1fae94ad585135a5d33ee38df
Author: Rodrigo Silveira <ro...@outlook.com>
Date:   2014-07-09T22:46:50Z

    Support for resolve URI, request all paths and local app directory.

----


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

[GitHub] cordova-plugin-file pull request: [FxOS] Support for resolve URI, ...

Posted by zalun <gi...@git.apache.org>.
Github user zalun commented on a diff in the pull request:

    https://github.com/apache/cordova-plugin-file/pull/64#discussion_r15390363
  
    --- Diff: src/firefoxos/FileProxy.js ---
    @@ -54,6 +53,32 @@ QUIRKS:
         var DIR_SEPARATOR = '/';
         var DIR_OPEN_BOUND = String.fromCharCode(DIR_SEPARATOR.charCodeAt(0) + 1);
     
    +    var pathsPrefix = {
    +        // Read-only directory where the application is installed.
    +        applicationDirectory: location.origin + "/",
    +        // Root of app's private writable storage
    +        applicationStorageDirectory: null,
    +        // Where to put app-specific data files.
    +        dataDirectory: 'file:///persistent/',
    +        // Cached files that should survive app restarts.
    +        // Apps should not rely on the OS to delete files in here.
    +        cacheDirectory: 'file:///temporary/',
    +        // Android: the application space on external storage.
    +        externalApplicationStorageDirectory: null,
    +        // Android: Where to put app-specific data files on external storage.
    +        externalDataDirectory: null,
    +        // Android: the application cache on external storage.
    +        externalCacheDirectory: null,
    +        // Android: the external storage (SD card) root.
    +        externalRootDirectory: null,
    +        // iOS: Temp directory that the OS can clear at will.
    +        tempDirectory: null,
    +        // iOS: Holds app-specific files that should be synced (e.g. to iCloud).
    +        syncedDataDirectory: null,
    +        // iOS: Files private to the app, but that are meaningful to other applciations (e.g. Office files)
    +        documentsDirectory: null
    +    };
    +
    --- End diff --
    
    I think they're not needed, also confusing for someone who'd read the source. There is also no chance it's gonna be called in code... Please remove or if you think the message is needed - comment out.


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

[GitHub] cordova-plugin-file pull request: [FxOS] Support for resolve URI, ...

Posted by rodms10 <gi...@git.apache.org>.
Github user rodms10 commented on a diff in the pull request:

    https://github.com/apache/cordova-plugin-file/pull/64#discussion_r15371710
  
    --- Diff: src/firefoxos/FileProxy.js ---
    @@ -54,6 +53,32 @@ QUIRKS:
         var DIR_SEPARATOR = '/';
         var DIR_OPEN_BOUND = String.fromCharCode(DIR_SEPARATOR.charCodeAt(0) + 1);
     
    +    var pathsPrefix = {
    +        // Read-only directory where the application is installed.
    +        applicationDirectory: location.origin + "/",
    +        // Root of app's private writable storage
    +        applicationStorageDirectory: null,
    +        // Where to put app-specific data files.
    +        dataDirectory: 'file:///persistent/',
    +        // Cached files that should survive app restarts.
    +        // Apps should not rely on the OS to delete files in here.
    +        cacheDirectory: 'file:///temporary/',
    +        // Android: the application space on external storage.
    +        externalApplicationStorageDirectory: null,
    +        // Android: Where to put app-specific data files on external storage.
    +        externalDataDirectory: null,
    +        // Android: the application cache on external storage.
    +        externalCacheDirectory: null,
    +        // Android: the external storage (SD card) root.
    +        externalRootDirectory: null,
    +        // iOS: Temp directory that the OS can clear at will.
    +        tempDirectory: null,
    +        // iOS: Holds app-specific files that should be synced (e.g. to iCloud).
    +        syncedDataDirectory: null,
    +        // iOS: Files private to the app, but that are meaningful to other applciations (e.g. Office files)
    +        documentsDirectory: null
    +    };
    +
    --- End diff --
    
    No, they'll all default to null. I kept them here more for documenting what's available. I can remove if you prefer.


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

[GitHub] cordova-plugin-file pull request: [FxOS] Support for resolve URI, ...

Posted by zalun <gi...@git.apache.org>.
Github user zalun commented on the pull request:

    https://github.com/apache/cordova-plugin-file/pull/64#issuecomment-50120504
  
    r+


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

[GitHub] cordova-plugin-file pull request: [FxOS] Support for resolve URI, ...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/cordova-plugin-file/pull/64


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

[GitHub] cordova-plugin-file pull request: [FxOS] Support for resolve URI, ...

Posted by zalun <gi...@git.apache.org>.
Github user zalun commented on a diff in the pull request:

    https://github.com/apache/cordova-plugin-file/pull/64#discussion_r15286063
  
    --- Diff: src/firefoxos/FileProxy.js ---
    @@ -54,6 +53,32 @@ QUIRKS:
         var DIR_SEPARATOR = '/';
         var DIR_OPEN_BOUND = String.fromCharCode(DIR_SEPARATOR.charCodeAt(0) + 1);
     
    +    var pathsPrefix = {
    +        // Read-only directory where the application is installed.
    +        applicationDirectory: location.origin + "/",
    +        // Root of app's private writable storage
    +        applicationStorageDirectory: null,
    +        // Where to put app-specific data files.
    +        dataDirectory: 'file:///persistent/',
    +        // Cached files that should survive app restarts.
    +        // Apps should not rely on the OS to delete files in here.
    +        cacheDirectory: 'file:///temporary/',
    +        // Android: the application space on external storage.
    +        externalApplicationStorageDirectory: null,
    +        // Android: Where to put app-specific data files on external storage.
    +        externalDataDirectory: null,
    +        // Android: the application cache on external storage.
    +        externalCacheDirectory: null,
    +        // Android: the external storage (SD card) root.
    +        externalRootDirectory: null,
    +        // iOS: Temp directory that the OS can clear at will.
    +        tempDirectory: null,
    +        // iOS: Holds app-specific files that should be synced (e.g. to iCloud).
    +        syncedDataDirectory: null,
    +        // iOS: Files private to the app, but that are meaningful to other applciations (e.g. Office files)
    +        documentsDirectory: null
    +    };
    +
    --- End diff --
    
    Is there a need to define the parameters which will not be used in FFOS?


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