mozilla
Your Search Results

    DeviceStorage

    This article is in need of a technical review.

    この記事はまだ日本語に翻訳されていません。MDN の翻訳はボランティアによって行われています。是非 MDN に登録し、私たちの力になって下さい。

    Non-standard
    This feature is not on a current W3C standards track, but it is supported on the Firefox OS platform. Although implementations may change in the future and it is not supported widely across browsers, it is suitable for use in code dedicated to Firefox OS apps.

    This API is available on Firefox OS for internal applications only.

    Summary

    The 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.

    Properties

    DeviceStorage.storageName Read only
    A string representing the name of the storage area. It's the same as the one used when calling getDeviceStorage to get the DeviceStorage object.
    DeviceStorage.default Read only
    A Boolean value that indicates if this storage area is the default destination for storing new files (true) or not (false).

    Event handlers

    DeviceStorage.onchange
    A handler for the change event. This event occurs each time the storage area is updated.

    Methods

    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.

    Event handlers

    Methods inherited from the EventTarget interface:

    EventTarget.addEventListener()
    Register an event handler of a specific event type on the EventTarget.
    EventTarget.removeEventListener()
    Removes an event listener from the EventTarget.
    EventTarget.dispatchEvent()
    Dispatch an event to this EventTarget.

    Specification

    Not part of any specification.

    See also

    ドキュメントのタグと貢献者

    最終更新者: kscarfone,