You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by mnill <gi...@git.apache.org> on 2014/10/09 00:14:06 UTC

[GitHub] cordova-plugin-file pull request: Implementation of read only acce...

GitHub user mnill opened a pull request:

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

    Implementation of read only access to assets folder

    Hi there,
    I wrote cordova cloud updater for ours apps, and i have a problem like this: https://issues.apache.org/jira/browse/CB-6935
    
    This is my crazy code solution for read only access to file:///android_asset/ folder. 


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

    $ git pull https://github.com/mnill/cordova-plugin-file master

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

    https://github.com/apache/cordova-plugin-file/pull/84.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 #84
    
----
commit 5ae17729710624e9388e428bb09a976e385f6ab3
Author: MniLL <mn...@gmail.com>
Date:   2014-10-08T22:05:22Z

    implementation of read only access to assets folder

----


---
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.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-plugin-file pull request: Implementation of read only acce...

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

    https://github.com/apache/cordova-plugin-file/pull/84#issuecomment-82483511
  
    Thanks @mnill for your work here. Subclassing `File` was a bit too crazy to put into the main code, but I've now added support for assets with a new Filesystem subclass. Would love if you would give it a try by installing the plugin from master.


---
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.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-plugin-file pull request: Implementation of read only acce...

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

    https://github.com/apache/cordova-plugin-file/pull/84#issuecomment-77478232
  
    @ArnaudValensi my realization is simple.
    1) copy all files from www to PERSISTENT storage. (if not be copy before);
    2) download config.json from server
    3) check the version constants in downloaded config.json and local config.json.
    4) if different - download new files from server to PERSISENT, then override config.json.
    (download not all files, only new\different which are written in config.json as new. I have Grunt script for calculate a list of new files.)
    5) redirect window.location.href to persistent storage;
     


---
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.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-plugin-file pull request: Implementation of read only acce...

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

    https://github.com/apache/cordova-plugin-file/pull/84#issuecomment-77475566
  
    Okay, i found another bug, but not with my fork.
    private JSONArray requestAllFileSystems in FileUtils.java not have error handler for IOException, like a File not found. 
    
    If you have empty sdcard slot in your phone, this function will crash, and you never get callback for resolveLocalFileSystemURL.



---
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.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-plugin-file pull request: Implementation of read only acce...

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

    https://github.com/apache/cordova-plugin-file/pull/84#issuecomment-77792422
  
    @ArnaudValensi enjoy, https://github.com/mnill/cordova-app-updater
    Just proof of concept.


---
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.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-plugin-file pull request: Implementation of read only acce...

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

    https://github.com/apache/cordova-plugin-file/pull/84#issuecomment-82798149
  
    Hi!.
    Looks nice, but failed on some my tests.
    Doesn't works get directory entry. Sample:
    
    ```javascript
        document.addEventListener('deviceready', function() {load();}, false);
        function load() {
                window.resolveLocalFileSystemURI(cordova.file.applicationDirectory, function(applicationEntry){
                    applicationEntry.getDirectory('www', {create:false}, function(wwwEntry) {
                        alert('success to get application www Directory');
                    }, function(err) {
                        alert('fail get application www Directory' + err.code);
                    });
                }, function(err){
                    alert('fail get applicationDirectory' + err.code);
                })
        }
    ```
    resolveLocalFileSystemURI - > cordova.file.applicationDirectory works well, but getDirectory 'www' failed. 


---
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.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-plugin-file pull request: Implementation of read only acce...

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

    https://github.com/apache/cordova-plugin-file/pull/84#issuecomment-77478838
  
    @mnill awesome! I was thinking about something like that. I would be glad to use/test/improve it when it will be published.


---
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.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-plugin-file pull request: Implementation of read only acce...

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

    https://github.com/apache/cordova-plugin-file/pull/84#issuecomment-77442515
  
    @ArnaudValensi @dariosalviwork Can you provide sample of failed tests? please?


---
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.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-plugin-file pull request: Implementation of read only acce...

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

    https://github.com/apache/cordova-plugin-file/pull/84#issuecomment-77443680
  
    ```js
        function fail(e) {
        	console.log('FileSystem Error');
        	console.dir(e);
        }
    
        function success(dir) {
            console.log('success');
        	console.dir(dir);
        }
    
        function hotupdate() {
        	window.resolveLocalFileSystemURL(
                cordova.file.applicationDirectory,
                success,
                fail
            );
        }
    
        document.addEventListener('deviceready', hotupdate, false);
    ```
    
    My cordova version is: 4.1.2
    And I've installed your version of the file plugin.
    
    I'm trying to implement a hot code updater.


---
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.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-plugin-file pull request: Implementation of read only acce...

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

    https://github.com/apache/cordova-plugin-file/pull/84#issuecomment-77821892
  
    @mnill cool, thank you!


---
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.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-plugin-file pull request: Implementation of read only acce...

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

    https://github.com/apache/cordova-plugin-file/pull/84#issuecomment-77524839
  
    @ArnaudValensi you can look at https://github.com/markmarijnissen/cordova-app-loader 
    My version is more simple and small.


---
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.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-plugin-file pull request: Implementation of read only acce...

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

    https://github.com/apache/cordova-plugin-file/pull/84#issuecomment-77441938
  
    Doesn't work for me neither :'(


---
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.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-plugin-file pull request: Implementation of read only acce...

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

    https://github.com/apache/cordova-plugin-file/pull/84#issuecomment-70627512
  
    +1


---
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.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-plugin-file pull request: Implementation of read only acce...

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

    https://github.com/apache/cordova-plugin-file/pull/84#issuecomment-77545293
  
    @mnill yes, it's what I'm using, but there is some pitfalls. If you're using a third party library which try to relatively link a file it will not work. The regular files are loaded from `file:///android_asset/www`(for android) and the updated file from `cdvfile://...`. I'm using requirejs and I patched it to do the job, but it's very hacky and not very robust. My idea was to do something generic and working out of the box for everybody. What I was up to do is exactly what you've explained me :)


---
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.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-plugin-file pull request: Implementation of read only acce...

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

    https://github.com/apache/cordova-plugin-file/pull/84#issuecomment-77476072
  
    @ArnaudValensi I will publish my realization of hotupdate on weekend or next week.


---
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.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-plugin-file pull request: Implementation of read only acce...

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

    https://github.com/apache/cordova-plugin-file/pull/84#issuecomment-116716134
  
    Pull request is outdated from master. But the problem is still there.


---
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.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-plugin-file pull request: Implementation of read only acce...

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

    https://github.com/apache/cordova-plugin-file/pull/84#issuecomment-77476397
  
    @mnill Thanks, it would be great! Can you tell me what is the idea of the design?


---
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.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-plugin-file pull request: Implementation of read only acce...

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

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


---
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.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


[GitHub] cordova-plugin-file pull request: Implementation of read only acce...

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

    https://github.com/apache/cordova-plugin-file/pull/84#issuecomment-75285312
  
    Did not work on my tests unfortunately.


---
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.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org