Class StorageService

All Implemented Interfaces:
CtxEventListener, ContextHandleAware, HandleAware, Ready, ReadyAndReadyListener, ReadyListener

public final class StorageService extends AbstractService
Service that manages storage devices that are detected via udev events, such as usb drives. Devices are tracked and can be dynamically mounted and unmounted from the local filesystem. All mounts occur at /mnt/storage and are placed in directories based on a UUID assigned to the device. The actual mount path is available in the StorageDevice when mounted.

Devices should only be mounted while in use to minimize the possibility of disk corruption as a result of removing the device while in use. The default mount options use synchronous writes (see MountOption.USB so that the device can be unmounted after writing without significant delay. It is possible to define custom mount options, including filesystem specific options.

Since:
1.0
Version:
2024-04-30
  • Field Details

  • Method Details

    • getDevices

      public Collection<StorageDevice> getDevices()
      Return the list of available storage devices.
    • getDeviceById

      public StorageDevice getDeviceById(String deviceId)
      Return the storage device with the specified id.
      Parameters:
      deviceId - the id of the device