HTML5 DirectoryEntry


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
createReader       Y Y YY
getDirectory       Y Y YY
getFile       Y Y YY
getMetadata       Y Y YY
getParent       Y Y YY
moveTo       Y Y YY
remove       Y Y YY
removeRecursively       Y Y YY
toURL       Y Y YY
filesystem       Y Y YY
fullPath       Y Y YY
isDirectory       Y Y YY
isFile       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.


Properties

Functions

void copyTo (original : DirectoryEntry, newName : String, callback: function(), callback: function())


Copies the directory to a new location. When copying to a location where the name already exists, copyTo will attempt to overwrite it.


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


Parameters
original directory
newName new name of directory
callback function to execute when it is successful
callback function to execute when there is a failure

DirectoryReader createReader ()


creates a new DirectoryReader to read contents in a directory


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


Return:

The directoryReader object


void getDirectory (path : String, options : flags, callback: function(), callback: function())


Create or look up a directory.


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


Parameters
path - path of the directory to be looked up or created.
options - options to specify whether the directory is to be created if it doesn't exist
callback function that is called with a File object. (Function)
callback function to execute when there is an error during creating the File object. Invoked with a FileError object. (Function)

void getFile (path : String, options : flags, callback: function(), callback: function())


Creates or look up a file.


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


Parameters
path - path of the file to be looked up or created.
options - options to specify whether the file is created if it doesn't exist
callback function that is called with a File object. (Function)
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())


Look up metadata about a directory.


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

Code Example:
Main script:

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


returns the parent DirectoryEntry


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

void moveTo (The : DirectoryEntry, The : String, callback: function(), callback: function())


Moves a directory to a different location. When moving the directory to a location where the name already exists, moveTo will attempt to overwrite it.


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


Parameters
The directory that you want to move
The new name of the directory. Defaults to the current name if unspecified.
callback function to execute when it is successful
callback function to execute when there is a failure

Code Example:
Main script:

void remove (callback: function(), callback: function())


function to delete a directory.


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

void removeRecursively (callback: function(), callback: function())


Delete a directory and all of its contents.


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


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

string toURL ()


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


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

Properties

static File filesystem


The file system on which the DirectoryEntry resides


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

static File fullPath


The full absolute path from the root to the DirectoryEntry


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

static boolean isDirectory


Returns whether the object is a directory or not. Value is always true.


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

static boolean isFile


Returns whether the object is a file or not. Value is always false.


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)