This API is available on Firefox OS for internal applications 仅。
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.
DeviceStorage.default
只读
true
) 或不 (
false
).
DeviceStorage.lowDiskSpace
只读
true
if this storage area is close to being full.
DeviceStorage.storageName
只读
A string representing the name of the storage area.
DeviceStorage.onchange
change
event. This event occurs each time the storage area is updated.
DeviceStorage.add()
Adds a file to the storage area. The name of the file is automatically generated.
DeviceStorage.addNamed()
Adds a file to the storage area. The name of the file is specified when calling the method.
DeviceStorage.available()
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.
DeviceStorage.delete()
Removes a file from the storage area.
DeviceStorage.enumerate()
Iterates over the list of files available in the storage area. The files retrieved through this method are read only.
DeviceStorage.enumerateEditable()
Iterates over the list of files available in the storage area.
DeviceStorage.freeSpace()
Retrieves the total amount of free space available in the storage area.
DeviceStorage.get()
Retrieves a read only file from the storage area.
DeviceStorage.getEditable()
Retrieves an editable file from the storage area.
DeviceStorage.usedSpace()
Retrieves the total amount of space used by the storage area.
Methods inherited from the
EventTarget
接口:
EventTarget.addEventListener()
EventTarget
.
EventTarget.removeEventListener()
EventTarget
.
EventTarget.dispatchEvent()
EventTarget
.
Mozilla extensions for use by JS-implemented event targets to implement on* properties. See also WebIDL 绑定 .
Not part of any specification.