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 java.lang.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 java.lang.String PROTOCOL_FILE
           
protected static java.lang.String PROTOCOL_FTP
           
protected static java.lang.String PROTOCOL_HTTP
           
protected static java.lang.String PROTOCOL_HTTPS
           
 
Constructor Summary
ImageDownloader()
           
 
Method Summary
 java.io.InputStream getStream(java.net.URI imageUri)
          Retrieves InputStream of image by URI.
protected  java.io.InputStream getStreamFromFile(java.net.URI imageUri)
          Retrieves InputStream of image by URI (image is located on the local file system or SD card)
protected abstract  java.io.InputStream getStreamFromNetwork(java.net.URI imageUri)
          Retrieves InputStream of image by URI (image is located in the network)
protected  java.io.InputStream getStreamFromOtherSource(java.net.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 java.lang.String PROTOCOL_FILE
See Also:
Constant Field Values

PROTOCOL_HTTP

protected static final java.lang.String PROTOCOL_HTTP
See Also:
Constant Field Values

PROTOCOL_HTTPS

protected static final java.lang.String PROTOCOL_HTTPS
See Also:
Constant Field Values

PROTOCOL_FTP

protected static final java.lang.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 java.io.InputStream getStream(java.net.URI imageUri)
                              throws java.io.IOException
Retrieves InputStream of image by URI. Image can be located as in the network and on local file system.

Throws:
java.io.IOException

getStreamFromOtherSource

protected java.io.InputStream getStreamFromOtherSource(java.net.URI imageUri)
                                                throws java.io.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:
java.io.IOException

getStreamFromNetwork

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

Throws:
java.io.IOException

getStreamFromFile

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

Throws:
java.io.IOException


Copyright © 2011-2013. All Rights Reserved.