java.lang.Object | |
↳ | com.salesforce.android.knowledge.core.offline.OfflineResourceConfig.Builder |
Builder class for OfflineResourceConfig
instances.
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
protected int | mConcurrentRequests | ||||||||||
protected int | mMaxSize | ||||||||||
protected Collection<String> | mMediaTypes |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Builder() |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
OfflineResourceConfig |
build()
Build an
OfflineResourceConfig instance with the current values. | ||||||||||
OfflineResourceConfig.Builder |
concurrentRequests(int concurrentRequests)
Set the maximum number of resources that will be downloaded concurrently.
| ||||||||||
OfflineResourceConfig.Builder |
maxSize(int maxSize)
Set the maximum size to consume on disk for the offline resource cache, in bytes.
| ||||||||||
OfflineResourceConfig.Builder |
mediaTypes(Collection<String> types)
Set the media types that will be accepted to the offline cache.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Build an OfflineResourceConfig
instance with the current values.
OfflineResourceConfig
instance.
Set the maximum number of resources that will be downloaded concurrently. Higher numbers will give more throughput when downloading but consume more memory. Applications should be aware that setting this value too high could potentially lead to an OutOfMemoryError. Defaults to the number of processors on the device.
concurrentRequests | The maximum number of concurrent downloads. |
---|
IllegalArgumentException | If concurrentRequests is not greater than zero.
|
---|
Set the maximum size to consume on disk for the offline resource cache, in bytes. The cache will purge older items to ensure it stays under this maximum size. The default size is 10MB.
maxSize | The maximum cache size in bytes. |
---|
IllegalArgumentException | If maxSize is an invalid value.
|
---|
Set the media types that will be accepted to the offline cache. These strings match against
the type()
of the content type response header. Only responses with headers
matching a string in this collection will be cached for offline viewing - this allows the
application to avoid polluting the cache with invalid content. Defaults to "image".
types | The media types to accept to the offline cache. |
---|