You’re reading the English version of this content since no translation exists yet for this locale. Help us translate this article!
DeviceStorage interface is used to access files on a specific storage area available on the device. A storage area is, in essence, a file system repository even if it hides the reality of the underlying file system.
To access a storage area, you must use the
navigator.getDeviceStorage() method, which returns
DeviceStorage objects. You then use those objects' methods and properties to access the content of the storage area.
- A Boolean value that indicates if this storage area is the default destination for storing new files (
true) or not (
- A Boolean value that returns
trueif this storage area is close to being full.
- A string representing the name of the storage area.
- A handler for the
changeevent. This event occurs each time the storage area is updated.
- Adds a file to the storage area. The name of the file is automatically generated.
- Adds a file to the storage area. The name of the file is specified when calling the method.
- Reports "available" when the storage area is available for use and "shared" when the storage area is mounted on a computer using the device's USB connection.
- Removes a file from the storage area.
- Iterates over the list of files available in the storage area. The files retrieved through this method are read only.
- Iterates over the list of files available in the storage area.
- Retrieves the total amount of free space available in the storage area.
- Retrieves a read only file from the storage area.
- Retrieves an editable file from the storage area.
- Retrieves the total amount of space used by the storage area.
Methods inherited from the
- Register an event handler of a specific event type on the
- Removes an event listener from the
- Dispatch an event to this
Additional methods for Mozilla chrome code
Mozilla extensions for use by JS-implemented event targets to implement on* properties. See also WebIDL bindings.
- void setEventHandler(DOMString type, EventHandler handler)
- EventHandler getEventHandler(DOMString type)
Not part of any specification.