public class

HttpUrlConnectionNetworkFetcher

extends BaseNetworkFetcher<FETCH_STATE extends FetchState>
java.lang.Object
   ↳ com.facebook.imagepipeline.producers.BaseNetworkFetcher<FETCH_STATE extends com.facebook.imagepipeline.producers.FetchState>
     ↳ com.facebook.imagepipeline.producers.HttpUrlConnectionNetworkFetcher

Class Overview

Network fetcher that uses the simplest Android stack.

Apps requiring more sophisticated networking should implement their own NetworkFetcher.

Summary

Nested Classes
class HttpUrlConnectionNetworkFetcher.HttpUrlConnectionNetworkFetchState  
Constants
int HTTP_DEFAULT_TIMEOUT
int HTTP_PERMANENT_REDIRECT
int HTTP_TEMPORARY_REDIRECT
Public Constructors
HttpUrlConnectionNetworkFetcher()
HttpUrlConnectionNetworkFetcher(int httpConnectionTimeout)
HttpUrlConnectionNetworkFetcher(String userAgent, int httpConnectionTimeout)
HttpUrlConnectionNetworkFetcher(String userAgent, Map<String, String> requestHeaders, int httpConnectionTimeout)
Public Methods
HttpUrlConnectionNetworkFetcher.HttpUrlConnectionNetworkFetchState createFetchState(Consumer<EncodedImage> consumer, ProducerContext context)
void fetch(HttpUrlConnectionNetworkFetcher.HttpUrlConnectionNetworkFetchState fetchState, NetworkFetcher.Callback callback)
Map<String, String> getExtraMap(HttpUrlConnectionNetworkFetcher.HttpUrlConnectionNetworkFetchState fetchState, int byteSize)
Gets a map containing extra parameters to pass to the listeners.
void onFetchCompletion(HttpUrlConnectionNetworkFetcher.HttpUrlConnectionNetworkFetchState fetchState, int byteSize)
Called after the fetch completes.
[Expand]
Inherited Methods
From class com.facebook.imagepipeline.producers.BaseNetworkFetcher
From class java.lang.Object
From interface com.facebook.imagepipeline.producers.NetworkFetcher

Constants

public static final int HTTP_DEFAULT_TIMEOUT

Constant Value: 30000 (0x00007530)

public static final int HTTP_PERMANENT_REDIRECT

Constant Value: 308 (0x00000134)

public static final int HTTP_TEMPORARY_REDIRECT

Constant Value: 307 (0x00000133)

Public Constructors

public HttpUrlConnectionNetworkFetcher ()

public HttpUrlConnectionNetworkFetcher (int httpConnectionTimeout)

public HttpUrlConnectionNetworkFetcher (String userAgent, int httpConnectionTimeout)

public HttpUrlConnectionNetworkFetcher (String userAgent, Map<String, String> requestHeaders, int httpConnectionTimeout)

Public Methods

public Map<String, String> getExtraMap (HttpUrlConnectionNetworkFetcher.HttpUrlConnectionNetworkFetchState fetchState, int byteSize)

Gets a map containing extra parameters to pass to the listeners.

Returning map is optional and is useful for instrumentation purposes.

This map won't be modified by the caller.

Parameters
fetchState the fetch-specific state
byteSize size of the data in bytes
Returns
  • a map with extra parameters

public void onFetchCompletion (HttpUrlConnectionNetworkFetcher.HttpUrlConnectionNetworkFetchState fetchState, int byteSize)

Called after the fetch completes.

Implementing this method is optional and is useful for instrumentation purposes.

Parameters
fetchState the fetch-specific state
byteSize size of the data in bytes