# Class Storage#removeAll

storage

- Defined in: storage.js

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

  Property | Type | Description | Required
  --- | --- | --- | ---
  device | String | device 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