HTML5 FileEntry


Supported Platform(s)

- BlackBerry PlayBook 1.0+
- BlackBerry 10
- Ripple Emulator
View Supported Platform Table
APIBB5.0BB6.0BB7.0PB1.0PB2.0BB10Ripple
copyTo       Y Y YY
createWriter       Y Y YY
file       Y Y YY
getMetadata       Y Y YY
getParent       Y Y YY
moveTo       Y Y YY
remove       Y Y YY
toURL       Y Y YY

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.

Functions

void copyTo
void createWriter
void file
void getMetadata
void getParent
void moveTo
void remove
string toURL

Functions

void copyTo (parent : DirectoryEntry, newName : String, callback: function(), callback : errorCallback)


Copy function to copy a file to another location in the file system.


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


Parameters
parent directory to copy the file to
newName New file name.
callback function to execute when it is successful
callback function to execute when there is a failure

void createWriter (callback: function(), callback: function())


creates the writer to write into the file


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


Parameters
callback function that is called with a FileWriter object.
callback function to execute when there is a failure. Invoked with a FileError object.

void file (callback: function(), callback: function())


Return a File object that represents the current state of the file that this FileEntry represents.


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


Parameters
callback function that is called with a File object.
callback function to execute when there is an error during creating the File object. Invoked with a FileError object. (Function)

void getMetadata (callback: function(), callback: function())


returns information (metadata) regarding to the fileEntry


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


Parameters
callback function that will execute when the event occurs successfully.
callback function that will execute when the event fails

void getParent (callback: function(), callback: function())


returns the parent directoryEntry containing the specified fileEntry


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


Parameters
callback function to execute when it is successful
callback function to execute when there is a failure

Code Example:
function success(parent) {
	console.log("Parent Name: " + parent.name);
}

function fail(error) {
	alert(error.code);
}

// Get the parent DirectoryEntry
entry.getParent(success, fail);

void moveTo (parent : DirectoryEntry, newName : String, callback: function(), callback: function())


moves a file to a different location on the file system


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


Parameters
parent directory to move the file to
newName The new name of the file.
callback function to execute when it is successful
callback function to execute when there is a failure

void remove (Callback: function(), Callback: function())


deletes the file from the filesystem


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


Parameters
Callback function when the file is successful
Callback function when there is a failure

string toURL ()


Returns a URL that can be used to locate the file.


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

Documentation generated by JsDoc Toolkit 2.4.0 on Mon Feb 11 2013 14:51:06 GMT-0500 (EST)