addFileSystemListener

This method is used to register a FileSystemListener that is
notified in case of adding and removing a new file system root.
Multiple file system listeners can be added. If file
systems are not supported on a device, false is returned from
the method (this check is performed prior to security checks).

Parameters:

listener - The new FileSystemListener to be registered in
order to handle adding/removing file system roots.

Returns:

boolean indicating if file system listener was successfully
added or not

listRoots

This method returns the currently mounted root file systems on a device
as String objects in an Enumeration.
If there are no roots available on the device, a zero length Enumeration
is returned. If file systems are not supported on a device, a zero
length Enumeration is also returned (this check is performed prior to
security checks).

The first directory in the file URI is referred to as the root,
which corresponds to a logical mount point for a particular storage
unit or memory. Root strings are defined by the platform or
implementation and can be a string of zero or more characters ("" can be
a valid root string on some systems) followed by a trailing "/" to denote
that the root is a directory. Each root string is guaranteed to uniquely
refer to a root. Root names are
device specific and are not required to adhere to any standard.
Examples of possible root strings and how to open them include:

Possible Root Value

Opening the Root

CFCard/

Connector.open("file:///CFCard/");

SDCard/

Connector.open("file:///SDCard/");

MemoryStick/

Connector.open("file:///MemoryStick/");

C:/

Connector.open("file:///C:/");

/

Connector.open("file:////");

The following is a sample showing the use of listRoots to retrieve
the available size of all roots on a device: