public final class DownloaderConstructorHelper
extends java.lang.Object
Downloader construction.| Constructor and Description |
|---|
DownloaderConstructorHelper(Cache cache,
DataSource.Factory upstreamDataSourceFactory) |
DownloaderConstructorHelper(Cache cache,
DataSource.Factory upstreamDataSourceFactory,
DataSource.Factory cacheReadDataSourceFactory,
DataSink.Factory cacheWriteDataSinkFactory,
PriorityTaskManager priorityTaskManager) |
| Modifier and Type | Method and Description |
|---|---|
CacheDataSource |
buildCacheDataSource(boolean offline)
Returns a new
CacheDataSource instance. |
Cache |
getCache()
Returns the
Cache instance. |
PriorityTaskManager |
getPriorityTaskManager()
Returns a
PriorityTaskManager instance. |
public DownloaderConstructorHelper(Cache cache, DataSource.Factory upstreamDataSourceFactory)
cache - Cache instance to be used to store downloaded data.upstreamDataSourceFactory - A DataSource.Factory for downloading data.public DownloaderConstructorHelper(Cache cache, DataSource.Factory upstreamDataSourceFactory, @Nullable DataSource.Factory cacheReadDataSourceFactory, @Nullable DataSink.Factory cacheWriteDataSinkFactory, @Nullable PriorityTaskManager priorityTaskManager)
cache - Cache instance to be used to store downloaded data.upstreamDataSourceFactory - A DataSource.Factory for downloading data.cacheReadDataSourceFactory - A DataSource.Factory for reading data from the cache.
If null, null is passed to Downloader constructor.cacheWriteDataSinkFactory - A DataSink.Factory for writing data to the cache. If
null, null is passed to Downloader constructor.priorityTaskManager - If one is given then the download priority is set lower than
loading. If null, null is passed to Downloader constructor.public PriorityTaskManager getPriorityTaskManager()
PriorityTaskManager instance.public CacheDataSource buildCacheDataSource(boolean offline)
CacheDataSource instance. If offline is true, it can only read
data from the cache.