Java Code Examples for com.danikula.videocache.file.TotalSizeLruDiskUsage

The following examples show how to use com.danikula.videocache.file.TotalSizeLruDiskUsage. These examples are extracted from open source projects. 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 Project: AndriodVideoCache   Source File: HttpProxyCacheServer.java    License: 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 Project: DKVideoPlayer   Source File: HttpProxyCacheServer.java    License: 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 Project: GSYVideoPlayer   Source File: HttpProxyCacheServer.java    License: 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 Project: AndroidVideoCache   Source File: HttpProxyCacheServer.java    License: 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 Project: AndriodVideoCache   Source File: HttpProxyCacheServer.java    License: 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 Project: DKVideoPlayer   Source File: HttpProxyCacheServer.java    License: 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 Project: GSYVideoPlayer   Source File: HttpProxyCacheServer.java    License: 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 Project: AndroidVideoCache   Source File: HttpProxyCacheServer.java    License: 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;
}