Class AssetFileDescriptorLocalUriFetcher

  • All Implemented Interfaces:
    DataFetcher<android.content.res.AssetFileDescriptor>

    public final class AssetFileDescriptorLocalUriFetcher
    extends LocalUriFetcher<android.content.res.AssetFileDescriptor>
    Fetches an AssetFileDescriptor for a local Uri.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void close​(android.content.res.AssetFileDescriptor data)
      Closes the concrete data type if necessary.
      java.lang.Class<android.content.res.AssetFileDescriptor> getDataClass()
      Returns the class of the data this fetcher will attempt to obtain.
      protected android.content.res.AssetFileDescriptor loadResource​(android.net.Uri uri, android.content.ContentResolver contentResolver)
      Returns a concrete data type from the given Uri using the given ContentResolver.
      • Methods inherited from class java.lang.Object

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

      • AssetFileDescriptorLocalUriFetcher

        public AssetFileDescriptorLocalUriFetcher​(android.content.ContentResolver contentResolver,
                                                  android.net.Uri uri)
    • Method Detail

      • loadResource

        protected android.content.res.AssetFileDescriptor loadResource​(android.net.Uri uri,
                                                                       android.content.ContentResolver contentResolver)
                                                                throws java.io.FileNotFoundException
        Description copied from class: LocalUriFetcher
        Returns a concrete data type from the given Uri using the given ContentResolver.
        Specified by:
        loadResource in class LocalUriFetcher<android.content.res.AssetFileDescriptor>
        Throws:
        java.io.FileNotFoundException
      • close

        protected void close​(android.content.res.AssetFileDescriptor data)
                      throws java.io.IOException
        Description copied from class: LocalUriFetcher
        Closes the concrete data type if necessary.

        Note - We can't rely on the closeable interface because it was added after our min API level. See issue #157.

        Specified by:
        close in class LocalUriFetcher<android.content.res.AssetFileDescriptor>
        Parameters:
        data - The data to close.
        Throws:
        java.io.IOException
      • getDataClass

        @NonNull
        public java.lang.Class<android.content.res.AssetFileDescriptor> getDataClass()
        Description copied from interface: DataFetcher
        Returns the class of the data this fetcher will attempt to obtain.