blackberry/cordova-js — pull request #18 by bryanhiggins (2013-04-10 13:48:53+00:00)
Title: Implement File APIs

I'm putting this up in progress so we can discuss the implementation.

By adding these files in lib/blackberry10/plugin, they overwrite the files of the same name in common. That way we can write thin wrappers to resolve differences between the cordova spec and our WebKit implementation.

The alternative is to keep common js and handle the exec calls. To me that feels unnatural as we would need to request a new file system for every operation and pump file data into a cordovaCallback.

So far this implementation only handles local file system operations. We need to come up with a strategy for toggling the sandbox. I would first like to completely understand how this is handled on iOS and Android. It seems like there are already inconsistencies between those two.

At this point 68/95 tests are passing. Most of the failures are in FileReader/FileWriter which I haven't yet gotten to.

Some other points of failure are:
- error code mismatches
- getFile { create: true, exclusive: true } always errors
- directories cannot contain spaces
- colons in filenames are not valid, but they work on BB10