com.esf.device.usb.manager.storage.service
Interface IUsbStorageManagerService


public interface IUsbStorageManagerService

The USB Storage Manager Service provides tools for management of USB Mass Storage devices.


Field Summary
static java.lang.String SERVICE_NAME
          Reports the class name representing this interface.
static java.lang.String USB_STORAGE_ATTACHED
           
static java.lang.String USB_STORAGE_DETACHED
           
 
Method Summary
 boolean areDevicesPresent()
          This method returns whether or not there are any devices currently attached.
 java.lang.String getDeviceNode(java.lang.String usbPortNumber)
          This method returns the device node that has been assigned to the USB Mass Storage device attached to a specified USB port.
 java.lang.String[] getDeviceUsbPorts()
          Returns an array of Strings that represent the USB port names of the connected devices.
 java.lang.String[] getPartitions(java.lang.String deviceNode)
          Returns a list of Strings representing the partitions on the storage device, null if no partitions exits.
 boolean mountDevice(java.lang.String deviceNode, java.lang.String mountPoint, java.lang.String type)
          This method mounts a specified USB Mass Storage device to a specified mount point.
 void registerListener(UsbStorageListener listener)
          This method registers an USB Storage Listener to be notified when a device has been attached or detached
 boolean unmountDevice(java.lang.String mountPoint)
          This method unmounts a specified USB Mass Storage device.
 void unregisterListener(UsbStorageListener listener)
          This method unregisters an USB Storage Listener
 

Field Detail

SERVICE_NAME

public static final java.lang.String SERVICE_NAME
Reports the class name representing this interface.


USB_STORAGE_ATTACHED

public static final java.lang.String USB_STORAGE_ATTACHED
See Also:
Constant Field Values

USB_STORAGE_DETACHED

public static final java.lang.String USB_STORAGE_DETACHED
See Also:
Constant Field Values
Method Detail

areDevicesPresent

public boolean areDevicesPresent()
This method returns whether or not there are any devices currently attached.

Returns:
True if there are any devices attached, false otherwise.

getDeviceUsbPorts

public java.lang.String[] getDeviceUsbPorts()
Returns an array of Strings that represent the USB port names of the connected devices.

Returns:
An array of Strings that represent the USB port names of the connected devices

getDeviceNode

public java.lang.String getDeviceNode(java.lang.String usbPortNumber)
This method returns the device node that has been assigned to the USB Mass Storage device attached to a specified USB port.

Parameters:
usbPortNumber - A String representing the USB port that the device is plugged into.
Returns:
A String representing the device node that has been assigned to the device. Null if no device is connected to the specified USB port.

mountDevice

public boolean mountDevice(java.lang.String deviceNode,
                           java.lang.String mountPoint,
                           java.lang.String type)
This method mounts a specified USB Mass Storage device to a specified mount point.

Parameters:
deviceNode - A String representing the USB device node assigned to the USB device.
mountPoint - A String representing the mount point for the USB device to be mounted to.
type - The filesystem type to mount the device as
Returns:
True if the mount was successful, false otherwise.

unmountDevice

public boolean unmountDevice(java.lang.String mountPoint)
This method unmounts a specified USB Mass Storage device.

Parameters:
mountPoint - A String representing the mount point for the USB device to be unmounted.
Returns:
True if the unmount was successful, false otherwise.

registerListener

public void registerListener(UsbStorageListener listener)
This method registers an USB Storage Listener to be notified when a device has been attached or detached

Parameters:
listener - A class implementing the UsbStorageListener interface

unregisterListener

public void unregisterListener(UsbStorageListener listener)
This method unregisters an USB Storage Listener

Parameters:
listener - A class implementing the UsbStorageListener interface

getPartitions

public java.lang.String[] getPartitions(java.lang.String deviceNode)
Returns a list of Strings representing the partitions on the storage device, null if no partitions exits.

Parameters:
deviceNode - A String representing the USB device node assigned to the USB device.
Returns:
An Array of Strings representing the partitions on the storage device, null if none


Copyright © 2009 Eurotech Inc. All rights reserved.