HTML5 DirectoryEntry
Supported Platform(s)
| - BlackBerry PlayBook 1.0+ |
| - BlackBerry 10 |
| - Ripple Emulator |
| API | BB5.0 | BB6.0 | BB7.0 | PB1.0 | PB2.0 | BB10 | Ripple |
|---|---|---|---|---|---|---|---|
| copyTo | Y | Y | Y | Y | |||
| createReader | Y | Y | Y | Y | |||
| getDirectory | Y | Y | Y | Y | |||
| getFile | Y | Y | Y | Y | |||
| getMetadata | Y | Y | Y | Y | |||
| getParent | Y | Y | Y | Y | |||
| moveTo | Y | Y | Y | Y | |||
| remove | Y | Y | Y | Y | |||
| removeRecursively | Y | Y | Y | Y | |||
| toURL | Y | Y | Y | Y | |||
| filesystem | Y | Y | Y | Y | |||
| fullPath | Y | Y | Y | Y | |||
| isDirectory | Y | Y | Y | Y | |||
| isFile | Y | Y | Y | Y |
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 |
| DirectoryReader | createReader |
| void | getDirectory |
| void | getFile |
| void | getMetadata |
| void | getParent |
| void | moveTo |
| void | remove |
| void | removeRecursively |
| string | toURL |
Properties
| File | filesystem |
| File | fullPath |
| boolean | isDirectory |
| boolean | isFile |
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
(The : String, Options : flags, callback: function())
Create or look up a directory.
| Supported Platforms | |
|---|---|
| - BlackBerry PlayBook 1.0+ | |
| - BlackBerry 10 | |
| - Ripple Emulator | |
| Parameters | |
|---|---|
| The | path of the directory to be looked up or created |
| 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 {errorCallback} 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. |
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:
|
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:
|
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. |
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 | |