HTML5 LocalFileSystem


Supported Platform(s)

- BlackBerry PlayBook 1.0+
- BlackBerry 10
- Ripple Emulator
View Supported Platform Table
APIBB5.0BB6.0BB7.0PB1.0PB2.0BB10Ripple
requestFileSystem       Y Y YY
resolveLocalFileSystemURI       Y Y YY
PERSISTENT             
TEMPORARY             

Configuration Document Settings

To use all of the API described for this object, you must ensure the following settings are in your configuration document:

This API does not require a <feature> element to be declared in the configuration document of your BlackBerry WebWorks Application.

Permission Elements (PlayBook and BlackBerry 10+)
This API does not require a <permission> element to be declared in the configuration document of your BlackBerry WebWorks Application.


Constants

String PERSISTENT
String TEMPORARY

Functions

void requestFileSystem (String : string, callback: function(), callback: function())


Requests the filesystem.


Supported Platforms
 - BlackBerry PlayBook 1.0+
 - BlackBerry 10
 - Ripple Emulator


Parameters
String to indicate the LocalFileSystem.type (ie. LocalFileSystem.PERSISTENT or LocalFileSystem.TEMPORARY)
callback function that is invoked on successful request of a file system. Argument passed in is the FileSystem object
callback function for handling errors or when the request to obtain the file system is denied. Argument passed in is the FileError object

Code Example:
Main script:

<script type="text/javascript">
function onInitFs(fs) {
		console.log('Opened file system: ' + fs.name);
}

window.requestFileSystem(window.TEMPORARY, 5*1024*1024  onInitFs, errorHandler);    // 5*1024*1024 = 5MB


</script>

void resolveLocalFileSystemURI (Full : String, size : integer, callback: function(), Optional: function())


Requests the DirectoryEntry or FileEntry Object using local URI.


Supported Platforms
 - BlackBerry PlayBook 1.0+
 - BlackBerry 10
 - Ripple Emulator


Parameters
Full path and name of file
size (in bytes) the app will require for storage
callback function that is invoked on successful request of a file system. Argument passed in is the FileSystem object
Optional callback for handling errors or when the request to obtain the file system is denied. Argument passed in is the FileError object

Code Example:
Main script:

<script type="text/javascript">

function onSuccess(fileEntry) {
		console.log(fileEntry.name);
}

window.resolveLocalFileSystemURI("file:///example.txt", onSuccess, onError);    * </script>

Constants

static String PERSISTENT


Localstorage that will persists after application has been completed.


Supported Platforms

static String TEMPORARY


Localstorage that is temporary


Supported Platforms

Documentation generated by JsDoc Toolkit 2.4.0 on Sun Dec 30 2012 18:15:40 GMT-0500 (EST)