-
public final class HttpProxyCacheServer.BuilderBuilder for HttpProxyCacheServer.
-
-
Constructor Summary
Constructors Constructor Description HttpProxyCacheServer.Builder(Context context)
-
Method Summary
Modifier and Type Method Description HttpProxyCacheServer.BuildercacheDirectory(File file)Overrides default cache folder to be used for caching files. HttpProxyCacheServer.BuilderfileNameGenerator(FileNameGenerator fileNameGenerator)Overrides default cache file name generator Md5FileNameGenerator . HttpProxyCacheServer.BuildermaxCacheSize(long maxSize)Sets max cache size in bytes. HttpProxyCacheServer.BuildermaxCacheFilesCount(int count)Sets max cache files count.All files that exceeds limit will be deleted using LRU strategy. HttpProxyCacheServer.BuilderdiskUsage(DiskUsage diskUsage)Set custom DiskUsage logic for handling when to keep or clean cache. HttpProxyCacheServer.BuilderheaderInjector(HeaderInjector headerInjector)Add headers along the request to the server HttpProxyCacheServer.BuilderhostnameVerifier(HostnameVerifier v)HttpProxyCacheServer.BuildertrustAllCerts(Array<TrustManager> trustAllCerts)HttpProxyCacheServerbuild()Builds new instance of HttpProxyCacheServer. -
-
Constructor Detail
-
HttpProxyCacheServer.Builder
HttpProxyCacheServer.Builder(Context context)
-
-
Method Detail
-
cacheDirectory
HttpProxyCacheServer.Builder cacheDirectory(File file)
Overrides default cache folder to be used for caching files.
By default AndroidVideoCache uses'/Android/data/[app_package_name]/cache/video-cache/' if card is mounted and app has appropriate permissionor 'video-cache' subdirectory in default application's cache directory otherwise.
Note directory must be used only for AndroidVideoCache files.- Parameters:
file- a cache directory, can't be null.
-
fileNameGenerator
HttpProxyCacheServer.Builder fileNameGenerator(FileNameGenerator fileNameGenerator)
Overrides default cache file name generator Md5FileNameGenerator .
- Parameters:
fileNameGenerator- a new file name generator.
-
maxCacheSize
HttpProxyCacheServer.Builder maxCacheSize(long maxSize)
Sets max cache size in bytes.
All files that exceeds limit will be deleted using LRU strategy.Default value is 512 Mb.
Note this method overrides result of calling maxCacheFilesCount- Parameters:
maxSize- max cache size in bytes.
-
maxCacheFilesCount
HttpProxyCacheServer.Builder maxCacheFilesCount(int count)
Sets max cache files count.All files that exceeds limit will be deleted using LRU strategy.Note this method overrides result of calling maxCacheSize
- Parameters:
count- max cache files count.
-
diskUsage
HttpProxyCacheServer.Builder diskUsage(DiskUsage diskUsage)
Set custom DiskUsage logic for handling when to keep or clean cache.
- Parameters:
diskUsage- a disk usage strategy, cant be{@code null}.
-
headerInjector
HttpProxyCacheServer.Builder headerInjector(HeaderInjector headerInjector)
Add headers along the request to the server
- Parameters:
headerInjector- to inject header base on url
-
hostnameVerifier
HttpProxyCacheServer.Builder hostnameVerifier(HostnameVerifier v)
-
trustAllCerts
HttpProxyCacheServer.Builder trustAllCerts(Array<TrustManager> trustAllCerts)
-
build
HttpProxyCacheServer build()
Builds new instance of HttpProxyCacheServer.
-
-
-
-