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

Language Reference only       
StorageVolume 
3D:
Context3D
Context3DBlendFactor
Context3DClearMask
Context3DCompareMode
Context3DProgramType
Context3DRenderMode
Context3DStencilAction
Context3DTextureFormat
Context3DTriangleFace
Context3DVertexBufferFormat
CubeTexture
IndexBuffer3D
Program3D
Stage3D
Texture
VertexBuffer3D
Air.net:
ServiceMonitor
SocketMonitor
URLMonitor
Air.update:
ApplicationUpdater
ApplicationUpdaterUI
DownloadErrorEvent
StatusFileUpdateErrorEvent
StatusFileUpdateEvent
StatusUpdateErrorEvent
StatusUpdateEvent
UpdateEvent
Data:
EncryptedLocalStore
SQLCollationType
SQLColumnNameStyle
SQLColumnSchema
SQLConnection
SQLError
SQLErrorEvent
SQLErrorOperation
SQLEvent
SQLIndexSchema
SQLMode
SQLResult
SQLSchema
SQLSchemaResult
SQLStatement
SQLTableSchema
SQLTransactionLockType
SQLTriggerSchema
SQLUpdateEvent
SQLViewSchema
Desktop:
Clipboard
ClipboardFormats
ClipboardTransferMode
DockIcon
Icon
InteractiveIcon
NativeApplication
NativeProcess
NativeProcessStartupInfo
NotificationType
SystemTrayIcon
Display:
BitmapData
NativeMenu
NativeMenuItem
Screen
Stage
StageDisplayState
StageQuality
Events:
ActivityEvent
AsyncErrorEvent
BrowserInvokeEvent
DataEvent
DatagramSocketDataEvent
DNSResolverEvent
DRMAuthenticateEvent
DRMStatusEvent
ErrorEvent
Event
EventDispatcher
FileListEvent
HTTPStatusEvent
InvokeEvent
InvokeEventReason
IOErrorEvent
LocationChangeEvent
MouseEvent
NativeProcessExitEvent
NetDataEvent
NetMonitorEvent
NetStatusEvent
OutputProgressEvent
ProgressEvent
SampleDataEvent
SecurityErrorEvent
ServerSocketConnectEvent
StatusEvent
StorageVolumeChangeEvent
TimerEvent
UncaughtErrorEvent
UncaughtErrorEvents
File:
File
FileMode
FileStream
StorageVolume
StorageVolumeInfo
Functions:
trace()
generateRandomBytes()
navigateToURL()
sendToURL()
Geom:
Matrix
Point
Rectangle
Media:
AudioDecoder
AudioPlaybackMode
H264Level
H264Profile
H264VideoStreamSettings
ID3Info
InputMediaStream
Microphone
MicrophoneEnhancedMode
MicrophoneEnhancedOptions
Sound
SoundChannel
SoundCodec
SoundLoaderContext
SoundMixer
SoundTransform
VideoCodec
VideoStatus
VideoStreamSettings
Native window:
NativeWindow
NativeWindowBoundsEvent
NativeWindowDisplayState
NativeWindowDisplayStateEvent
NativeWindowInitOptions
NativeWindowRenderMode
NativeWindowResize
NativeWindowSystemChrome
NativeWindowType
Net:
AAAARecord
ARecord
CertificateStatus
DatagramSocket
DNSResolver
FileFilter
InterfaceAddress
IPVersion
LocalConnection
MXRecord
NetConnection
NetMonitor
NetStreamAppendBytesAction
NetStreamMulticastInfo
NetworkInfo
NetworkInterface
ObjectEncoding
PTRRecord
ResourceRecord
Responder
SecureSocket
ServerSocket
SharedObject
SharedObjectFlushStatus
Socket
SRVRecord
URLLoader
URLLoaderDataFormat
URLRequest
URLRequestDefaults
URLRequestHeader
URLRequestMethod
URLStream
URLVariables
XMLSocket
Security:
ReferencesValidationSetting
RevocationCheckSettings
SignatureStatus
SignerTrustSettings
X500DistinguishedName
X509Certificate
XMLSignatureValidator
System:
Capabilities
Security
System
Updater
Ui:
Keyboard
KeyboardType
KeyLocation
Mouse
MouseCursorData
Utils:
Vector
ByteArray
Collator
CollatorMode
CompressionAlgorithm
CurrencyFormatter
CurrencyParseResult
DateTimeFormatter
DateTimeNameContext
DateTimeNameStyle
DateTimeStyle
Endian
HTMLLoader
HTMLPDFCapability
LastOperationStatus
LocaleID
NationalDigitsType
NumberFormatter
NumberParseResult
StringTools
Timer
window.runtime propertywindow.runtime.flash.filesystem.StorageVolume
InheritanceStorageVolume Inheritance Object

Runtime Versions:  2

A StorageVolume object includes properties defining a mass storage volume. This class is used in two ways:
  • The storageVolume property of a StorageVolumeChangeEvent object is a StorageVolume object. This object represents the storage volume that has been mounted or unmounted.
  • The StorageVolumeInfo.storageVolumeInfo.getStorageVolumes() method returns a vector of StorageVolume objects. Each of these StorageVolume objects represents a mounted storage volume.

View the examples

See also



Properties
 PropertyDefined By
 Inheritedconstructor : Object
A reference to the class object or constructor function for a given object instance.
Object
  drive : String
[read-only] The volume drive letter on Windows.
StorageVolume
  fileSystemType : String
[read-only] The type of file system on the storage volume (such as "FAT", "NTFS", "HFS", or "UFS").
StorageVolume
  isRemovable : Boolean
[read-only] Whether the operating system considers the storage volume to be removable (true) or not (false).
StorageVolume
  isWritable : Boolean
[read-only] Whether a volume is writable (true) or not (false).
StorageVolume
  name : String
[read-only] The name of the volume.
StorageVolume
 Inheritedprototype : Object
[static] A reference to the prototype object of a class or function object.
Object
  rootDirectory : File
[read-only] A File object corresponding to the root directory of the volume.
StorageVolume
Public Methods
 MethodDefined By
  
StorageVolume(rootDirPath:File, name:String, writable:Boolean, removable:Boolean, fileSysType:String, drive:String)
The constructor function.
StorageVolume
 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
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
Property Detail

drive

property
drive:String  [read-only]

Runtime Versions:  2

The volume drive letter on Windows. On other platforms, this property is set to null.

fileSystemType

property 
fileSystemType:String  [read-only]

Runtime Versions:  2

The type of file system on the storage volume (such as "FAT", "NTFS", "HFS", or "UFS").


Example  ( How to use this example )
The following code lists the native path for the root directory and the file system type 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, "(" + volumes[i].fileSystemType + ")");
}

isRemovable

property 
isRemovable:Boolean  [read-only]

Runtime Versions:  2

Whether the operating system considers the storage volume to be removable (true) or not (false).

The following table lists the values StorageVolume.isRemovable property for various types of devices:

Type of deviceMac OSWindowsLinux
CD/DVD (fixed)truetruetrue
USB flash drivetruetruetrue
USB hard srivefalsefalsetrue
FireWire hard drivefalsefalsetrue
Shared volumetruefalse- 1
Network drivefalsefalsefalse
Storage card reader (empty)- 2false- 2
Storage card reader (with SD/CF card)truetruetrue

1 Linux does not have a concept of a shared volume.

2 On Windows, an empty card reader is listed as a non-removable device. On Mac OS and Linux, empty car readers are not listed as storage volumes.


Example  ( How to use this example )
The following code outputs a list of non-removable storage volumes, followed by a list of removable storage volumes:
var volumes = air.StorageVolumeInfo.storageVolumeInfo.getStorageVolumes();

air.trace("Non-removeable volumes:");
for (var i = 0; i < volumes.length; i++)
{
    if (!volumes[i].isRemovable)
    {
        air.trace(volumes[i].rootDirectory.nativePath);
    }
}

air.trace("\nRemoveable volumes:");
for (i = 0; i < volumes.length; i++)
{
    if (volumes[i].isRemovable)
    {
        air.trace(volumes[i].rootDirectory.nativePath);
    }
}

isWritable

property 
isWritable:Boolean  [read-only]

Runtime Versions:  2

Whether a volume is writable (true) or not (false).

Note: You can determine the amount of space available on a volume by calling the rootDirectory.spaceAvailble property of the StorageVolume object.


Example  ( How to use this example )
The following code outputs a list of writable storage volumes and the space available on each:
var volumes = air.StorageVolumeInfo.storageVolumeInfo.getStorageVolumes();

for (var i = 0; i < volumes.length; i++)
{
    if(volumes[i].isWritable)
    {         
        air.trace(volumes[i].rootDirectory.nativePath, volumes[i].rootDirectory.spaceAvailable);
    }
}

name

property 
name:String  [read-only]

Runtime Versions:  2

The name of the volume. If there is no name, this property is set to null.


Example  ( How to use this example )
The following code lists the native path for the root directory and the file system name (if there is one) of each mounted storage volume:
var volumes = air.StorageVolumeInfo.storageVolumeInfo.getStorageVolumes();
for (var i; i < volumes.length; i++)
{
    var name = new String();
    if (volumes[i].name)
    {
        name = "(" + volumes[i].name + ")";
    }
    air.trace(volumes[i].rootDirectory.nativePath, name);
}

rootDirectory

property 
rootDirectory:File  [read-only]

Runtime Versions:  2

A File object corresponding to the root directory of the volume.


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);
}
Constructor Detail

StorageVolume

()Constructor
public function StorageVolume(rootDirPath:File, name:String, writable:Boolean, removable:Boolean, fileSysType:String, drive:String)

Runtime Versions:  2

The constructor function. Generally, you do not call this constructor function directly (to create new StorageVolume objects). Rather, you reference StorageVolume objects by accessing the storageVolume property of a StorageVolumeChangeEvent object or by calling StorageVolumeInfo.storageVolumeInfo.getStorageVolumes().

Parameters
rootDirPath:File
 
name:String
 
writable:Boolean
 
removable:Boolean
 
fileSysType:String
 
drive:String
Examples

The following code lists the properties of each mounted storage volume:
<html>
   <head>
   <title>Test</title>
   <script type="text/javascript" src="AIRAliases.js"></script>
   <script type="text/javascript"> 
   
   function traceVolumes()
   {
      var volumes = air.StorageVolumeInfo.storageVolumeInfo.getStorageVolumes();
      for (var i = 0; i < volumes.length; i++)
      {
         var volume = volumes[i];
         air.trace("nativePath:", volume.rootDirectory.nativePath);
         air.trace("fileSystemType:", volume.fileSystemType);
         air.trace("isRemovable:", volume.isRemovable);
         air.trace("isWritable:", volume.isWritable);
         air.trace("drive:", volume.drive);
         air.trace("name:", volume.name);
         air.trace("________________________________________________________");
      }
   }
   
   </script>
   </head>
   
   <body onload="traceVolumes()">
   </body>
</html>

The following code lists the properties of each storage volume that becomes mounted or unmounted. Note that the storageVolume property of the StorageVolumeChangeEvent is only set for the storageVolumeMount event; it is null for the storageVolumeUnmount event:
air.StorageVolumeInfo.storageVolumeInfo.addEventListener(air.StorageVolumeChangeEvent.STORAGE_VOLUME_MOUNT, mountEventHandler);
air.StorageVolumeInfo.storageVolumeInfo.addEventListener(air.StorageVolumeChangeEvent.STORAGE_VOLUME_UNMOUNT, unmountEventHandler);

function mountEventHandler(event)
{            
    var volume = event.storageVolume;
    air.trace("VOLUME MOUNTED:");
    air.trace("nativePath:", event.rootDirectory.nativePath);
    air.trace("fileSystemType:", volume.fileSystemType);
    trace("isRemovable:", volume.isRemovable);
    air.trace("isWritable:", volume.isWritable);
    air.trace("drive:", volume.drive);
    air.trace("name:", volume.name);
    air.trace();
}
function unmountEventHandler(event)
{            
    air.trace("VOLUME UNMOUNTED:");
    air.trace("nativePath:", event.rootDirectory.nativePath);
    air.trace();
}