com.nostra13.universalimageloader.core.download
Class ImageDownloader

java.lang.Object
  extended by com.nostra13.universalimageloader.core.download.ImageDownloader
Direct Known Subclasses:
HttpClientImageDownloader, URLConnectionImageDownloader

public abstract class ImageDownloader
extends Object

Provides retrieving of InputStream of image by URI.

Author:
Sergey Tarasevich (nostra13[at]gmail[dot]com)

Field Summary
protected static int BUFFER_SIZE
           
protected static String PROTOCOL_FILE
           
protected static String PROTOCOL_FTP
           
protected static String PROTOCOL_HTTP
           
protected static String PROTOCOL_HTTPS
           
 
Constructor Summary
ImageDownloader()
           
 
Method Summary
 InputStream getStream(URI imageUri)
          Retrieves InputStream of image by URI.
protected  InputStream getStreamFromFile(URI imageUri)
          Retrieves InputStream of image by URI (image is located on the local file system or SD card)
protected abstract  InputStream getStreamFromNetwork(URI imageUri)
          Retrieves InputStream of image by URI (image is located in the network)
protected  InputStream getStreamFromOtherSource(URI imageUri)
          Retrieves InputStream of image by URI from other source.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROTOCOL_FILE

protected static final String PROTOCOL_FILE
See Also:
Constant Field Values

PROTOCOL_HTTP

protected static final String PROTOCOL_HTTP
See Also:
Constant Field Values

PROTOCOL_HTTPS

protected static final String PROTOCOL_HTTPS
See Also:
Constant Field Values

PROTOCOL_FTP

protected static final String PROTOCOL_FTP
See Also:
Constant Field Values

BUFFER_SIZE

protected static final int BUFFER_SIZE
See Also:
Constant Field Values
Constructor Detail

ImageDownloader

public ImageDownloader()
Method Detail

getStream

public InputStream getStream(URI imageUri)
                      throws IOException
Retrieves InputStream of image by URI. Image can be located as in the network and on local file system.

Throws:
IOException

getStreamFromOtherSource

protected InputStream getStreamFromOtherSource(URI imageUri)
                                        throws IOException
Retrieves InputStream of image by URI from other source. Should be overriden by successors to implement image downloading from special sources (not local file and not web URL).

Throws:
IOException

getStreamFromNetwork

protected abstract InputStream getStreamFromNetwork(URI imageUri)
                                             throws IOException
Retrieves InputStream of image by URI (image is located in the network)

Throws:
IOException

getStreamFromFile

protected InputStream getStreamFromFile(URI imageUri)
                                 throws IOException
Retrieves InputStream of image by URI (image is located on the local file system or SD card)

Throws:
IOException


Copyright © 2011-2013. All Rights Reserved.