Adobe® AIR® API Reference for HTML Developers
Home  |  Show Classes List |  Index  |  Appendixes

Language Reference only       
StorageVolumeInfo 
window.runtime propertywindow.runtime.flash.filesystem.StorageVolumeInfo
InheritanceStorageVolumeInfo Inheritance EventDispatcher Inheritance Object

Runtime Versions:  2

The StorageVolumeInfo object dispatches a StorageVolumeChangeEvent object when a storage volume is mounted or unmounted. The StorageVolume.storageVolume static property references the singleton StorageVolumeInfo object, which dispatches the events. The StorageVolumeInfo class also defines a getStorageVolumes method for listing currently mounted storage volumes.

On modern Linux distributions, the StorageVolumeInfo object only dispatches storageVolumeMount and storageVolumeUnmount events for physical devices and network drives mounted at particular locations.

See also



Properties
 PropertyDefined By
 Inheritedconstructor : Object
A reference to the class object or constructor function for a given object instance.
Object
  isSupported : Boolean
[static] [read-only] The isSupported property is set to true if the StorageVolumeInfo class is supported on the current platform, otherwise it is set to false.
StorageVolumeInfo
 Inheritedprototype : Object
[static] A reference to the prototype object of a class or function object.
Object
  storageVolumeInfo : StorageVolumeInfo
[static] [read-only] The singleton instance of the StorageVolumeInfo object.
StorageVolumeInfo
Public Methods
 MethodDefined By
 Inherited
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Registers an event listener object with an EventDispatcher object so that the listener receives notification of an event.
EventDispatcher
 Inherited
dispatchEvent(event:Event):Boolean
Dispatches an event into the event flow.
EventDispatcher
  
getStorageVolumes():Vector.<StorageVolume>
Returns vector of StorageVolume objects corresponding to the currently mounted storage volumes.
StorageVolumeInfo
 Inherited
hasEventListener(type:String):Boolean
Checks whether the EventDispatcher object has any listeners registered for a specific type of event.
EventDispatcher
 Inherited
hasOwnProperty(name:String):Boolean
Indicates whether an object has a specified property defined.
Object
 Inherited
isPrototypeOf(theClass:Object):Boolean
Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter.
Object
 Inherited
propertyIsEnumerable(name:String):Boolean
Indicates whether the specified property exists and is enumerable.
Object
 Inherited
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
Removes a listener from the EventDispatcher object.
EventDispatcher
 Inherited
setPropertyIsEnumerable(name:String, isEnum:Boolean = true):void
Sets the availability of a dynamic property for loop operations.
Object
 Inherited
toLocaleString():String
Returns the string representation of this object, formatted according to locale-specific conventions.
Object
 Inherited
toString():String
Returns the string representation of the specified object.
Object
 Inherited
valueOf():Object
Returns the primitive value of the specified object.
Object
 Inherited
willTrigger(type:String):Boolean
Checks whether an event listener is registered with this EventDispatcher object or any of its ancestors for the specified event type.
EventDispatcher
Events
 Event Summary Defined By
 Inherited[broadcast event] Dispatched when the Flash Player or AIR application gains operating system focus and becomes active.EventDispatcher
 Inherited[broadcast event] Dispatched when the Flash Player or AIR application operating loses system focus and is becoming inactive.EventDispatcher
  Dispatched when a storage volume has been mounted.StorageVolumeInfo
  Dispatched when a storage volume has been unmounted.StorageVolumeInfo
Property Detail

isSupported

property
isSupported:Boolean  [read-only]

Runtime Versions:  2

The isSupported property is set to true if the StorageVolumeInfo class is supported on the current platform, otherwise it is set to false.

storageVolumeInfo

property 
storageVolumeInfo:StorageVolumeInfo  [read-only]

Runtime Versions:  2

The singleton instance of the StorageVolumeInfo object. Register event listeners on this object for the storageVolumeMount and storageVolumeUnmount events.

Method Detail

getStorageVolumes

()method
public function getStorageVolumes():Vector.<StorageVolume>

Runtime Versions:  2

Returns vector of StorageVolume objects corresponding to the currently mounted storage volumes.

On modern Linux distributions, this method returns objects corresponding to physical devices and network drives mounted at particular locations.

Returns
Vector.<StorageVolume>

See also


Example  ( How to use this example )

The following code lists the native path for the root directory of each mounted storage volume:
var volumes = air.StorageVolumeInfo.storageVolumeInfo.getStorageVolumes();
for (var i = 0; i < volumes.length; i++)
{
    air.trace(volumes[i].rootDirectory.nativePath);
}
Event Detail

storageVolumeMount

Event
Event Object Type: flash.events.StorageVolumeChangeEvent
property StorageVolumeChangeEvent.type = flash.events.StorageVolumeChangeEvent.STORAGE_VOLUME_MOUNT

Runtime Versions:  2

Dispatched when a storage volume has been mounted.

On modern Linux distributions, the StorageVolumeInfo object only dispatches storageVolumeMount and storageVolumeUnmount events for physical devices and network drives mounted at particular locations.

The StorageVolumeChangeEvent.VOLUME_MOUNT constant defines the value of the type property of a StorageVolumeChangeEvent when a volume is mounted.

The event has the following properties:

PropertyValue
bubblesfalse
cancelablefalse; there is no default behavior to cancel.
currentTargetThe StorageVolumeChangeEvent object.
fileA File object representing the storage volume.
nameThe name of the storage volume.
targetThe StorageVolumeChangeEvent object.
type"storageVolumeMount"

storageVolumeUnmount

Event  
Event Object Type: flash.events.StorageVolumeChangeEvent
property StorageVolumeChangeEvent.type = flash.events.StorageVolumeChangeEvent.STORAGE_VOLUME_UNMOUNT

Runtime Versions:  2

Dispatched when a storage volume has been unmounted.

On modern Linux distributions, the StorageVolumeInfo object only dispatches storageVolumeMount and storageVolumeUnmount events for physical devices and network drives mounted at particular locations.

The StorageVolumeChangeEvent.VOLUME_MOUNT constant defines the value of the type property of a StorageVolumeChangeEvent when a volume is unmounted.

The event has the following properties:

PropertyValue
bubblesfalse
cancelablefalse; there is no default behavior to cancel.
currentTargetThe StorageVolumeChangeEvent object.
fileA File object representing the storage volume.
nameThe name of the storage volume.
targetThe StorageVolumeChangeEvent object.
type"storageVolumeUnmount"