Class IOSStorageService

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Optional<java.io.File> getPrivateStorage()
      Get a storage directory that is private to the environment that is calling this method.
      java.util.Optional<java.io.File> getPublicStorage​(java.lang.String subdirectory)
      Get a public storage directory location.
      boolean isExternalStorageReadable()
      Checks if external storage is available for read access.
      boolean isExternalStorageWritable()
      Checks if external storage is available for read and write access.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • IOSStorageService

        public IOSStorageService()
    • Method Detail

      • getPrivateStorage

        public java.util.Optional<java.io.File> getPrivateStorage()
        Description copied from interface: StorageService
        Get a storage directory that is private to the environment that is calling this method. In the case of iOS or Android, the returned directory is private to the enclosing application.
        Specified by:
        getPrivateStorage in interface StorageService
        Returns:
        an optional with a private storage directory for an application
      • getPublicStorage

        public java.util.Optional<java.io.File> getPublicStorage​(java.lang.String subdirectory)
        Description copied from interface: StorageService
        Get a public storage directory location.

        Note that on Android the public location could be mapped to a removable memory device and may not always be available. Users of this method are advised to call StorageService.isExternalStorageWritable() or StorageService.isExternalStorageReadable() to avoid surprises.

        Note also that on Android, permissions will need to be set to access external storage. See: https://developer.android.com/training/basics/data-storage/files.html.

        Specified by:
        getPublicStorage in interface StorageService
        Parameters:
        subdirectory - under the root of public storage that is required. On Android the supplied subdirectory should not be null.
        Returns:
        an Optional of a File representing the requested directory location. The location may not yet exist. It is the responsibility of the programmer to ensure that the location exists before using it.
      • isExternalStorageWritable

        public boolean isExternalStorageWritable()
        Description copied from interface: StorageService
        Checks if external storage is available for read and write access.
        Specified by:
        isExternalStorageWritable in interface StorageService
        Returns:
        true if the externalStorage is writable (implies readable), false otherwise
      • isExternalStorageReadable

        public boolean isExternalStorageReadable()
        Description copied from interface: StorageService
        Checks if external storage is available for read access.
        Specified by:
        isExternalStorageReadable in interface StorageService
        Returns:
        true if the externalStorage is at least readable, false otherwise