blackberry / BB10-WebWorks-Framework

The BB10 WebWorks Framework is packaged within an application BAR file to run on a BB10 device (or simulator)
60 stars 34 forks source link

File System root as root of device when its unsandboxed is awkward #229

Open nukulb opened 12 years ago

nukulb commented 12 years ago

so I raised this long time ago but we didn't do anything about it. :(

so @gtanner raised as he was doing the Cordova port and it continues to be a weird api

I don't have a solution yet, this is more a place to brainstorm.

gtanner commented 12 years ago

Issue is the concept of sandboxed / unsandboxed.

The filesystem should have a standard root and folders to places of interest developers would want / expect to go:

Inspiration from Tizen and WAC could be used (virtual FileSystems) http://specs.wacapps.net/filesystem/index.html#virtual-file-system

https://developer.tizen.org/help/index.jsp?topic=%2Forg.tizen.help.web.api.device%2Ftizen%2Ffilesystem.html

Where folders are added to the root of the fileSystem (which should be the applications home in persistent, empty temp folder if temporary)

such as:

SDCard Videos Pictures Downloads ... etc

nukulb commented 12 years ago

shared folder is already symlinked and we can provide paths for sd cards etc.. using just APIs in the mean time.

nukulb commented 12 years ago

Two options as I see them-

  1. it would be nice that when I unsandbox the webview I can provide an actual path for it to root in. So I can customize the behaviour
  2. hack every method in the file system API. OMG, don't want to do this and then maintain for infinite time
gtanner commented 12 years ago

Could we just symlink into sandboxed folder?

Then get rid of the concept of unsandboxing?

nukulb commented 12 years ago

there are two sandbox folders temporary or persistent You can go their parent but thats not exactly less weird. You need to go the home of the app so that you can use the sym links.

gtanner commented 12 years ago

I am thinking:

persistent
    - SDCard
    - music
    - ...
temporary
    - (nothing cause we probably don't want to clean up "temp" files written to music)
nukulb commented 12 years ago

cc @dansilivestru

gtanner commented 12 years ago

Out of curiosity,

If I create a filesystem unsandboxed using the temporary flag and write a file to the sdcard.

when is it cleaned up? Since it was temporary? Sent on the TELUS Mobility network with BlackBerry

nukulb commented 12 years ago

in an unsandboxed environment temporary or persistent is ignored Everything is persistent except when you write in temporary folders on disk more awkwardness

nukulb commented 12 years ago

@gtanner - how do you feel about a sandbox:// protocol

that will take you to the sanbox directly where you have simlinks to shared folder

sandbox://shared will lead to

music
pictures
...
jeffheifetz commented 12 years ago

I like @gtanner 's idea in #284 about adding it to the requestFileSystem method. Perhaps as one of the constants.

nukulb commented 12 years ago

@jeffheifetz the two issues have nothing to do with each other. What are you talking about?

jeffheifetz commented 12 years ago

I like the idea of adding new constants to be used by the requestFileSystem method, such that the fileSystem object returned will either be sandboxed or not. It was simply brought up in issue #284

nukulb commented 12 years ago

well I think I have different idea now.

when unsandbox the file system currently it throws you to root, I am trying to get configured so that we throw the user the app sandbox which is symlinks for everything anyways.

like tristate webview api that allows all three states

gcsantiago commented 11 years ago

Guys, why you stop to talk about this issue? I wish to know how is the better way to getFile ... today i have this problem https://github.com/blackberry/BB10-WebWorks-Framework/issues/554#issuecomment-14091437