com.danikula.videocache.file.TotalSizeLruDiskUsage Java Examples

The following examples show how to use com.danikula.videocache.file.TotalSizeLruDiskUsage. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: HttpProxyCacheServer.java    From AndriodVideoCache with Apache License 2.0 5 votes vote down vote up
public Builder(Context context) {
    this.sourceInfoStorage = SourceInfoStorageFactory.newSourceInfoStorage(context);
    this.cacheRoot = StorageUtils.getIndividualCacheDirectory(context);
    this.diskUsage = new TotalSizeLruDiskUsage(DEFAULT_MAX_SIZE);
    this.fileNameGenerator = new Md5FileNameGenerator();
    this.headerInjector = new EmptyHeadersInjector();
}
 
Example #2
Source File: HttpProxyCacheServer.java    From DKVideoPlayer with Apache License 2.0 5 votes vote down vote up
public Builder(Context context) {
    this.sourceInfoStorage = SourceInfoStorageFactory.newSourceInfoStorage(context);
    this.cacheRoot = StorageUtils.getIndividualCacheDirectory(context);
    this.diskUsage = new TotalSizeLruDiskUsage(DEFAULT_MAX_SIZE);
    this.fileNameGenerator = new Md5FileNameGenerator();
    this.headerInjector = new EmptyHeadersInjector();
}
 
Example #3
Source File: HttpProxyCacheServer.java    From GSYVideoPlayer with Apache License 2.0 5 votes vote down vote up
public Builder(Context context) {
    this.sourceInfoStorage = SourceInfoStorageFactory.newSourceInfoStorage(context);
    this.cacheRoot = StorageUtils.getIndividualCacheDirectory(context);
    this.diskUsage = new TotalSizeLruDiskUsage(DEFAULT_MAX_SIZE);
    this.fileNameGenerator = new Md5FileNameGenerator();
    this.headerInjector = new EmptyHeadersInjector();
}
 
Example #4
Source File: HttpProxyCacheServer.java    From AndroidVideoCache with Apache License 2.0 5 votes vote down vote up
public Builder(Context context) {
    this.sourceInfoStorage = SourceInfoStorageFactory.newSourceInfoStorage(context);
    this.cacheRoot = StorageUtils.getIndividualCacheDirectory(context);
    this.diskUsage = new TotalSizeLruDiskUsage(DEFAULT_MAX_SIZE);
    this.fileNameGenerator = new Md5FileNameGenerator();
    this.headerInjector = new EmptyHeadersInjector();
}
 
Example #5
Source File: HttpProxyCacheServer.java    From AndriodVideoCache with Apache License 2.0 2 votes vote down vote up
/**
 * Sets max cache size in bytes.
 * <p>
 * All files that exceeds limit will be deleted using LRU strategy.
 * Default value is 512 Mb.
 * </p>
 * Note this method overrides result of calling {@link #maxCacheFilesCount(int)}
 *
 * @param maxSize max cache size in bytes.
 * @return a builder.
 */
public Builder maxCacheSize(long maxSize) {
    this.diskUsage = new TotalSizeLruDiskUsage(maxSize);
    return this;
}
 
Example #6
Source File: HttpProxyCacheServer.java    From DKVideoPlayer with Apache License 2.0 2 votes vote down vote up
/**
 * Sets max cache size in bytes.
 * <p>
 * All files that exceeds limit will be deleted using LRU strategy.
 * Default value is 512 Mb.
 * </p>
 * Note this method overrides result of calling {@link #maxCacheFilesCount(int)}
 *
 * @param maxSize max cache size in bytes.
 * @return a builder.
 */
public Builder maxCacheSize(long maxSize) {
    this.diskUsage = new TotalSizeLruDiskUsage(maxSize);
    return this;
}
 
Example #7
Source File: HttpProxyCacheServer.java    From GSYVideoPlayer with Apache License 2.0 2 votes vote down vote up
/**
 * Sets max cache size in bytes.
 * <p>
 * All files that exceeds limit will be deleted using LRU strategy.
 * Default value is 512 Mb.
 * </p>
 * Note this method overrides result of calling {@link #maxCacheFilesCount(int)}
 *
 * @param maxSize max cache size in bytes.
 * @return a builder.
 */
public Builder maxCacheSize(long maxSize) {
    this.diskUsage = new TotalSizeLruDiskUsage(maxSize);
    return this;
}
 
Example #8
Source File: HttpProxyCacheServer.java    From AndroidVideoCache with Apache License 2.0 2 votes vote down vote up
/**
 * Sets max cache size in bytes.
 * <p>
 * All files that exceeds limit will be deleted using LRU strategy.
 * Default value is 512 Mb.
 * </p>
 * Note this method overrides result of calling {@link #maxCacheFilesCount(int)}
 *
 * @param maxSize max cache size in bytes.
 * @return a builder.
 */
public Builder maxCacheSize(long maxSize) {
    this.diskUsage = new TotalSizeLruDiskUsage(maxSize);
    return this;
}