public static final class HttpProxyCacheServer.Builder
extends java.lang.Object
HttpProxyCacheServer.| Constructor and Description |
|---|
Builder(android.content.Context context) |
| Modifier and Type | Method and Description |
|---|---|
HttpProxyCacheServer |
build()
Builds new instance of
HttpProxyCacheServer. |
HttpProxyCacheServer.Builder |
cacheDirectory(java.io.File file)
Overrides default cache folder to be used for caching files.
|
HttpProxyCacheServer.Builder |
diskUsage(DiskUsage diskUsage)
Set custom DiskUsage logic for handling when to keep or clean cache.
|
HttpProxyCacheServer.Builder |
fileNameGenerator(FileNameGenerator fileNameGenerator)
Overrides default cache file name generator
Md5FileNameGenerator . |
HttpProxyCacheServer.Builder |
headerInjector(HeaderInjector headerInjector)
Add headers along the request to the server
|
HttpProxyCacheServer.Builder |
maxCacheFilesCount(int count)
Sets max cache files count.
|
HttpProxyCacheServer.Builder |
maxCacheSize(long maxSize)
Sets max cache size in bytes.
|
public HttpProxyCacheServer.Builder cacheDirectory(java.io.File file)
By default AndroidVideoCache uses '/Android/data/[app_package_name]/cache/video-cache/' if card is mounted and app has appropriate permission or 'video-cache' subdirectory in default application's cache directory otherwise.
Note directory must be used only for AndroidVideoCache files.file - a cache directory, can't be null.public HttpProxyCacheServer.Builder fileNameGenerator(FileNameGenerator fileNameGenerator)
Md5FileNameGenerator .fileNameGenerator - a new file name generator.public HttpProxyCacheServer.Builder maxCacheSize(long maxSize)
All files that exceeds limit will be deleted using LRU strategy. Default value is 512 Mb.
Note this method overrides result of callingmaxCacheFilesCount(int)maxSize - max cache size in bytes.public HttpProxyCacheServer.Builder maxCacheFilesCount(int count)
maxCacheSize(long)count - max cache files count.public HttpProxyCacheServer.Builder diskUsage(DiskUsage diskUsage)
diskUsage - a disk usage strategy, cant be null.public HttpProxyCacheServer.Builder headerInjector(HeaderInjector headerInjector)
headerInjector - to inject header base on urlpublic HttpProxyCacheServer build()
HttpProxyCacheServer.