Class Storage#removeAll

storage

Class Summary
Constructor Attributes Constructor Name and Description
 
Storage#removeAll(successCallback, errorCallback, options)
Removes all files in given file system.

Class Detail

Storage#removeAll(successCallback, errorCallback, options)
Removes all files in given file system.

function removeAll() {
   var successCb = function (cbObject){
     console.log( "Removed all files " ); 
   }; 

   var failureCb = function(cbObject){ 
     var errorCode = cbObject.errorCode;
     var errorText = cbObject.errorText; 
     console.log( " Error Code [" + errorCode + "]: " + errorText); 
   };

   var options = { 
     device: 'internal' // This will remove all files in the internal memory space.
   }; 

   var storage = new Storage();
   storage.removeAll(successCb, failureCb, options);
}
Parameters:
{Function} successCallback
success callback function.
{Function} errorCallback
failure callback function.
{Object} options
PropertyTypeDescriptionRequired
deviceStringdevice to remove all files from. (internal, usb:[index], sdcard:[index])required
Since:
1.2
Returns:

After the method is successfully executed, successCallback is called without any parameter.
If an error occurs, errorCallback is called with errorCode and errorText. To see how error codes are defined, check Error.ERROR_CODE