|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.nostra13.universalimageloader.core.download.BaseImageDownloader
public class BaseImageDownloader
Provides retrieving of InputStream
of image by URI from network or file system or app resources.
URLConnection
is used to retrieve image stream from network.
HttpClientImageDownloader
Field Summary | |
---|---|
protected static int |
BUFFER_SIZE
|
protected int |
connectTimeout
|
protected android.content.Context |
context
|
static int |
DEFAULT_HTTP_CONNECT_TIMEOUT
5000 |
static int |
DEFAULT_HTTP_READ_TIMEOUT
20000 |
protected int |
readTimeout
|
protected static String |
SCHEME_ASSETS_PREFIX
|
protected static String |
SCHEME_DRAWABLE_PREFIX
|
Fields inherited from interface com.nostra13.universalimageloader.core.download.ImageDownloader |
---|
SCHEME_ASSETS, SCHEME_CONTENT, SCHEME_DRAWABLE, SCHEME_FILE, SCHEME_HTTP, SCHEME_HTTPS |
Constructor Summary | |
---|---|
BaseImageDownloader(android.content.Context context)
|
|
BaseImageDownloader(android.content.Context context,
int connectTimeout,
int readTimeout)
|
Method Summary | |
---|---|
InputStream |
getStream(URI imageUri,
Object extra)
Retrieves InputStream of image by URI. |
protected InputStream |
getStreamFromAssets(URI imageUri,
Object extra)
Retrieves InputStream of image by URI (image is located in assets of application). |
protected InputStream |
getStreamFromContent(URI imageUri,
Object extra)
Retrieves InputStream of image by URI (image is accessed using ContentResolver ). |
protected InputStream |
getStreamFromDrawable(URI imageUri,
Object extra)
Retrieves InputStream of image by URI (image is located in drawable resources of application). |
protected InputStream |
getStreamFromFile(URI imageUri,
Object extra)
Retrieves InputStream of image by URI (image is located on the local file system or SD card). |
protected InputStream |
getStreamFromNetwork(URI imageUri,
Object extra)
Retrieves InputStream of image by URI (image is located in the network). |
protected InputStream |
getStreamFromOtherSource(URI imageUri,
Object extra)
Retrieves InputStream of image by URI from other source with unsupported scheme. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int DEFAULT_HTTP_CONNECT_TIMEOUT
public static final int DEFAULT_HTTP_READ_TIMEOUT
protected static final int BUFFER_SIZE
protected static final String SCHEME_ASSETS_PREFIX
protected static final String SCHEME_DRAWABLE_PREFIX
protected final android.content.Context context
protected final int connectTimeout
protected final int readTimeout
Constructor Detail |
---|
public BaseImageDownloader(android.content.Context context)
public BaseImageDownloader(android.content.Context context, int connectTimeout, int readTimeout)
Method Detail |
---|
public InputStream getStream(URI imageUri, Object extra) throws IOException
ImageDownloader
InputStream
of image by URI.
getStream
in interface ImageDownloader
imageUri
- Image URIextra
- Auxiliary object which was passed to DisplayImageOptions.extraForDownloader(Object)
; can be null
InputStream
of image
IOException
- if some I/O error occurs during getting image streamprotected InputStream getStreamFromNetwork(URI imageUri, Object extra) throws IOException
InputStream
of image by URI (image is located in the network).
imageUri
- Image URIextra
- Auxiliary object which was passed to DisplayImageOptions.extraForDownloader(Object)
; can be null
InputStream
of image
IOException
- if some I/O error occurs during network request or if no InputStream could be created for
URI.protected InputStream getStreamFromFile(URI imageUri, Object extra) throws IOException
InputStream
of image by URI (image is located on the local file system or SD card).
imageUri
- Image URIextra
- Auxiliary object which was passed to DisplayImageOptions.extraForDownloader(Object)
; can be null
InputStream
of image
IOException
- if some I/O error occurs reading from file systemprotected InputStream getStreamFromContent(URI imageUri, Object extra) throws FileNotFoundException
InputStream
of image by URI (image is accessed using ContentResolver
).
imageUri
- Image URIextra
- Auxiliary object which was passed to DisplayImageOptions.extraForDownloader(Object)
; can be null
InputStream
of image
FileNotFoundException
- if the provided URI could not be openedprotected InputStream getStreamFromAssets(URI imageUri, Object extra) throws IOException
InputStream
of image by URI (image is located in assets of application).
imageUri
- Image URIextra
- Auxiliary object which was passed to DisplayImageOptions.extraForDownloader(Object)
; can be null
InputStream
of image
IOException
- if some I/O error occurs file readingprotected InputStream getStreamFromDrawable(URI imageUri, Object extra)
InputStream
of image by URI (image is located in drawable resources of application).
imageUri
- Image URIextra
- Auxiliary object which was passed to DisplayImageOptions.extraForDownloader(Object)
; can be null
InputStream
of imageprotected InputStream getStreamFromOtherSource(URI imageUri, Object extra) throws IOException
InputStream
of image by URI from other source with unsupported scheme. Should be overriden by
successors to implement image downloading from special sources.UnsupportedOperationException
by
default.
imageUri
- Image URIextra
- Auxiliary object which was passed to DisplayImageOptions.extraForDownloader(Object)
; can be null
InputStream
of image
IOException
- if some I/O error occurs
UnsupportedOperationException
- @throws UnsupportedOperationException if image URI has unsupported
scheme(protocol)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |