PDAP Public Review Draft

javax.microedition.io
Class FileSystemRegistry

java.lang.Object
  |
  +--javax.microedition.io.FileSystemRegistry

public class FileSystemRegistry
extends java.lang.Object

The FileSystemRegistry is a central registry for file system listeners interested in the adding and removing (or mounting and unmounting) of file systems on a device.

Since:
PDAP 1.0
See Also:
FileConnection, FileSystemListener

Constructor Summary
FileSystemRegistry()
           
 
Method Summary
static void addFileSystemListener(FileSystemListener listener)
          This method is used to register a FileSystemListener that is notified in case of adding and removing a new file system root.
static java.lang.String[] listRoots()
          This method returns the currently mounted root file systems on a device.
static void removeFileSystemListener(FileSystemListener listener)
          This method is used to remove a registered FileSystemListener.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileSystemRegistry

public FileSystemRegistry()
Method Detail

addFileSystemListener

public static void addFileSystemListener(FileSystemListener listener)
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.
Parameters:
listener - The new FileSystemListener to be registered in order to handle adding/removing file system roots.
Throws:
SecurityException - if application is not given permission to read files.
java.lang.RuntimeException - if this method is not supported by the implementation.
See Also:
FileSystemListener, FileConnection

removeFileSystemListener

public static void removeFileSystemListener(FileSystemListener listener)
This method is used to remove a registered FileSystemListener.
Parameters:
listener - The FileSystemListener to be removed.
Throws:
java.lang.RuntimeException - if this method is not supported by the implementation.
See Also:
FileSystemListener, FileConnection

listRoots

public static java.lang.String[] listRoots()
This method returns the currently mounted root file systems on a device. If there are none available on the device, a zero length array is returned.
Returns:
a String array of mounted file systems.
Throws:
SecurityException - if application is not given permission to read files.
java.lang.RuntimeException - if this method is not supported by the implementation.
See Also:
FileSystemListener, FileConnection

PDAP 1.0 Spec, Rev. 0.16