JavaScript

{dialog.object}phoneGapRemoveDirectoryRecurseURL Method

Syntax

{dialog.object}.phoneGapRemoveDirectoryRecurseURL(dirPath, onRemoveSuccess, onError);

Arguments

dirPath

The path to the directory to remove. dirPath must end with a "/". EG, "path/to/directory/".

onRemoveSuccess

A Javascript function that is called if the deleting the directory is a success.

onError

A Javascript function that is called if an error occurs when trying to recursively delete the directory.

Description

Deletes the specified director and all of its contents, including other directories and their contents.

Example

var onRemoveSuccess = function() { 
    alert("Directory deleted!");
};
var onError = function(e) { 
    alert("An error occured when trying to delete the directory.");
};
var baseURI = {dialog.object}.phoneGapGetLocalDirURL('private');
var dirName = 'temp/';
var dirPath = baseURI + dirName;
{dialog.object}.phoneGapRemoveDirectoryRecurseURL(dirPath, onRemoveSuccess, onError);