com.bumptech.glide.loader.model
Class FileLoader

java.lang.Object
  extended by com.bumptech.glide.loader.model.FileLoader
All Implemented Interfaces:
ModelLoader<java.io.File>

public class FileLoader
extends java.lang.Object
implements ModelLoader<java.io.File>

A simple model loader for File


Nested Class Summary
static class FileLoader.Factory
           
 
Constructor Summary
FileLoader(android.content.Context context)
           
FileLoader(ModelLoader<android.net.Uri> uriLoader)
           
 
Method Summary
 java.lang.String getId(java.io.File model)
          Get a unique id for a given model
 StreamLoader getStreamLoader(java.io.File model, int width, int height)
          Obtain an StreamLoader that can asynchronously load and open an InputStream for the image represented by this model.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileLoader

public FileLoader(android.content.Context context)

FileLoader

public FileLoader(ModelLoader<android.net.Uri> uriLoader)
Method Detail

getStreamLoader

public StreamLoader getStreamLoader(java.io.File model,
                                    int width,
                                    int height)
Description copied from interface: ModelLoader
Obtain an StreamLoader that can asynchronously load and open an InputStream for the image represented by this model. The StreamLoader will not be used if the image is already cached.

Note - If the StringLoader in any way retains a reference a context, either directly or as an anonymous inner class, that context may be leaked. The leak will only be an issue if this load can run for a long time or indefinitely (because of a particularly slow or paused/failed download for example).

Specified by:
getStreamLoader in interface ModelLoader<java.io.File>
Parameters:
model - The model representing the image
width - The width of the view the image will be loaded into
height - The height of the view the image will be loaded into
Returns:
A StreamLoader that can obtain an InputStream for the image if it is not cached

getId

public java.lang.String getId(java.io.File model)
Description copied from interface: ModelLoader
Get a unique id for a given model

Specified by:
getId in interface ModelLoader<java.io.File>
Parameters:
model - The model
Returns:
A String that consistently and uniquely identifies this model. It can include width and height, but it does not have to.