com.android.repository.api
Interface Downloader

All Known Implementing Classes:
FakeDownloader

public interface Downloader

Implementations provide a general mechanism for downloading files.


Method Summary
 java.io.InputStream download(java.net.URL url, SettingsController settings, ProgressIndicator indicator)
          Gets a stream associated with the content at the given URL.
 

Method Detail

download

@Nullable
java.io.InputStream download(@NonNull
                                      java.net.URL url,
                                      @Nullable
                                      SettingsController settings,
                                      @NonNull
                                      ProgressIndicator indicator)
                             throws java.io.IOException
Gets a stream associated with the content at the given URL. This could be achieved by downloading the file completely, streaming it directly, or some combination.

Parameters:
url - The URL to fetch.
settings - Settings (e.g. proxy configuration) for the connection.
indicator - Facility for showing download progress and logging.
Returns:
An InputStream corresponding to the specified content, or null if the download is cancelled.
Throws:
java.io.IOException