/** * @param upstreamFactory A {@link DataSource.Factory} to be used to create an upstream {@link * DataSource} for {@link PriorityDataSource}. * @param priorityTaskManager The priority manager to which PriorityDataSource task is registered. * @param priority The priority of PriorityDataSource task. */ public PriorityDataSourceFactory(Factory upstreamFactory, PriorityTaskManager priorityTaskManager, int priority) { this.upstreamFactory = upstreamFactory; this.priorityTaskManager = priorityTaskManager; this.priority = priority; }
/** * @see CacheDataSource#CacheDataSource(Cache, DataSource, DataSource, DataSink, int, * EventListener) */ public CacheDataSourceFactory(Cache cache, Factory upstreamFactory, Factory cacheReadDataSourceFactory, DataSink.Factory cacheWriteDataSinkFactory, @CacheDataSource.Flags int flags, EventListener eventListener) { this.cache = cache; this.upstreamFactory = upstreamFactory; this.cacheReadDataSourceFactory = cacheReadDataSourceFactory; this.cacheWriteDataSinkFactory = cacheWriteDataSinkFactory; this.flags = flags; this.eventListener = eventListener; }
/** * @see CacheDataSource#CacheDataSource(Cache, DataSource, DataSource, DataSink, int, * EventListener) */ public CacheDataSourceFactory(Cache cache, Factory upstreamFactory, Factory cacheReadDataSourceFactory, DataSink.Factory cacheWriteDataSinkFactory, int flags, EventListener eventListener) { this.cache = cache; this.upstreamFactory = upstreamFactory; this.cacheReadDataSourceFactory = cacheReadDataSourceFactory; this.cacheWriteDataSinkFactory = cacheWriteDataSinkFactory; this.flags = flags; this.eventListener = eventListener; }
/** * @param cache Cache instance to be used to store downloaded data. * @param upstreamDataSourceFactory A {@link Factory} for downloading data. * @param cacheReadDataSourceFactory A {@link Factory} for reading data from the cache. * If null, null is passed to {@link Downloader} constructor. * @param cacheWriteDataSinkFactory A {@link DataSink.Factory} for writing data to the cache. If * null, null is passed to {@link Downloader} constructor. * @param priorityTaskManager If one is given then the download priority is set lower than * loading. If null, null is passed to {@link Downloader} constructor. */ public DownloaderConstructorHelper(Cache cache, Factory upstreamDataSourceFactory, @Nullable Factory cacheReadDataSourceFactory, @Nullable DataSink.Factory cacheWriteDataSinkFactory, @Nullable PriorityTaskManager priorityTaskManager) { Assertions.checkNotNull(upstreamDataSourceFactory); this.cache = cache; this.upstreamDataSourceFactory = upstreamDataSourceFactory; this.cacheReadDataSourceFactory = cacheReadDataSourceFactory; this.cacheWriteDataSinkFactory = cacheWriteDataSinkFactory; this.priorityTaskManager = priorityTaskManager; }
/** * @see CacheDataSource#CacheDataSource(Cache, DataSource) */ public CacheDataSourceFactory(Cache cache, DataSource.Factory upstreamFactory) { this(cache, upstreamFactory, 0); }
/** * @see CacheDataSource#CacheDataSource(Cache, DataSource, int) */ public CacheDataSourceFactory(Cache cache, DataSource.Factory upstreamFactory, @CacheDataSource.Flags int flags) { this(cache, upstreamFactory, flags, CacheDataSource.DEFAULT_MAX_CACHE_FILE_SIZE); }
/** * @see CacheDataSource#CacheDataSource(Cache, DataSource, int, long) */ public CacheDataSourceFactory(Cache cache, DataSource.Factory upstreamFactory, @CacheDataSource.Flags int flags, long maxCacheFileSize) { this(cache, upstreamFactory, new FileDataSourceFactory(), new CacheDataSinkFactory(cache, maxCacheFileSize), flags, null); }
/** * @see CacheDataSource#CacheDataSource(Cache, DataSource, int) */ public CacheDataSourceFactory(Cache cache, DataSource.Factory upstreamFactory, int flags) { this(cache, upstreamFactory, flags, CacheDataSource.DEFAULT_MAX_CACHE_FILE_SIZE); }
/** * @see CacheDataSource#CacheDataSource(Cache, DataSource, int, long) */ public CacheDataSourceFactory(Cache cache, DataSource.Factory upstreamFactory, int flags, long maxCacheFileSize) { this(cache, upstreamFactory, new FileDataSourceFactory(), new CacheDataSinkFactory(cache, maxCacheFileSize), flags, null); }
/** * @param context A context. * @param listener An optional listener. * @param baseDataSourceFactory A {@link Factory} to be used to create a base {@link DataSource} * for {@link DefaultDataSource}. * @see DefaultDataSource#DefaultDataSource(Context, TransferListener, DataSource) */ public DefaultDataSourceFactory(Context context, TransferListener<? super DataSource> listener, DataSource.Factory baseDataSourceFactory) { this.context = context.getApplicationContext(); this.listener = listener; this.baseDataSourceFactory = baseDataSourceFactory; }
/** * @param cache Cache instance to be used to store downloaded data. * @param upstreamDataSourceFactory A {@link Factory} for downloading data. */ public DownloaderConstructorHelper(Cache cache, Factory upstreamDataSourceFactory) { this(cache, upstreamDataSourceFactory, null, null, null); }