JavaScript
{dialog.object}phoneGapDeleteFilesNotInListURL Method
Syntax
{dialog.object}.phoneGapDeleteFilesNotInListURL(dirpath,filter,keepList,onSuccess,onError);
Arguments
- dirPath
The URL of the directory containing the files. The directory name must end in a forward slash '/'.
- filter
A regular expression used to filter the files.
- keepList
An array of filenames to keep. Any files found in this list, even if they match the filter, will not be deleted.
- onSuccess
A javascript function called if the call is successful.
- onError
A javascript function that is called if an error occurs.
Description
Deletes files from a directory. If a filter is specified, only files that match the filter are deleted. If a 'keep list' is specified, files in the list are not deleted, even if they match the filter.
Example
var onSuccess = function() { alert("Files were deleted"); }; var onError = function(e) { alert("An error occured."); }; var baseURI = {dialog.object}.phoneGapGetLocalDirURL('saved'); var dirName = 'mydir/'; var filter = ''; var keepList = ['file1.txt']; var dirPath = baseURI + dirName; {dialog.object}.phoneGapDeleteFilesNotInListURL(dirPath,filter,keepList, onSuccess, onError);