当前位置: 首页>>代码示例>>Java>>正文


Java DiskCache类代码示例

本文整理汇总了Java中com.nostra13.universalimageloader.cache.disc.DiskCache的典型用法代码示例。如果您正苦于以下问题:Java DiskCache类的具体用法?Java DiskCache怎么用?Java DiskCache使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


DiskCache类属于com.nostra13.universalimageloader.cache.disc包,在下文中一共展示了DiskCache类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createDiskCache

import com.nostra13.universalimageloader.cache.disc.DiskCache; //导入依赖的package包/类
/**
 * Creates default implementation of {@link DiskCache} depends on incoming parameters
 */
public static DiskCache createDiskCache(Context context, FileNameGenerator diskCacheFileNameGenerator,
		long diskCacheSize, int diskCacheFileCount) {
	File reserveCacheDir = createReserveDiskCacheDir(context);
	if (diskCacheSize > 0 || diskCacheFileCount > 0) {
		File individualCacheDir = StorageUtils.getIndividualCacheDirectory(context);
		try {
			return new LruDiskCache(individualCacheDir, reserveCacheDir, diskCacheFileNameGenerator, diskCacheSize,
					diskCacheFileCount);
		} catch (IOException e) {
			L.e(e);
			// continue and create unlimited cache
		}
	}
	File cacheDir = StorageUtils.getCacheDirectory(context);
	return new UnlimitedDiskCache(cacheDir, reserveCacheDir, diskCacheFileNameGenerator);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:20,代码来源:DefaultConfigurationFactory.java

示例2: createDiskCache

import com.nostra13.universalimageloader.cache.disc.DiskCache; //导入依赖的package包/类
/**
 * Creates default implementation of {@link DiskCache} depends on incoming parameters
 */
public static DiskCache createDiskCache(Context context, FileNameGenerator diskCacheFileNameGenerator,
		long diskCacheSize, int diskCacheFileCount) {
	File reserveCacheDir = createReserveDiskCacheDir(context);
	if (diskCacheSize > 0 || diskCacheFileCount > 0) {
		File individualCacheDir = StorageUtils.getIndividualCacheDirectory(context);
		try {
			return new LruDiscCache(individualCacheDir, reserveCacheDir, diskCacheFileNameGenerator, diskCacheSize,
					diskCacheFileCount);
		} catch (IOException e) {
			L.e(e);
			// continue and create unlimited cache
		}
	}
	File cacheDir = StorageUtils.getCacheDirectory(context);
	return new UnlimitedDiscCache(cacheDir, reserveCacheDir, diskCacheFileNameGenerator);
}
 
开发者ID:xulailing,项目名称:android-open-project-demo-master,代码行数:20,代码来源:DefaultConfigurationFactory.java

示例3: createDiskCache

import com.nostra13.universalimageloader.cache.disc.DiskCache; //导入依赖的package包/类
/**
 * 默认图片 本地路径缓存
 * Creates default implementation of {@link DiskCache} depends on incoming parameters
 */
public static DiskCache createDiskCache(Context context, FileNameGenerator diskCacheFileNameGenerator,
		long diskCacheSize, int diskCacheFileCount) {
	//创建备用缓存文件
	File reserveCacheDir = createReserveDiskCacheDir(context);
	if (diskCacheSize > 0 || diskCacheFileCount > 0) {
		File individualCacheDir = StorageUtils.getIndividualCacheDirectory(context);
		try {
			//创建本地文件系统缓存器
			return new LruDiskCache(individualCacheDir, reserveCacheDir, diskCacheFileNameGenerator, diskCacheSize,
					diskCacheFileCount);
		} catch (IOException e) {
			L.e(e);
			// continue and create unlimited cache
		}
	}
	//创建无限制的文件缓存器
	File cacheDir = StorageUtils.getCacheDirectory(context);
	return new UnlimitedDiskCache(cacheDir, reserveCacheDir, diskCacheFileNameGenerator);
}
 
开发者ID:jiangqqlmj,项目名称:Android-Universal-Image-Loader-Modify,代码行数:24,代码来源:DefaultConfigurationFactory.java

示例4: createDiskCache

import com.nostra13.universalimageloader.cache.disc.DiskCache; //导入依赖的package包/类
public static DiskCache createDiskCache(Context context, FileNameGenerator diskCacheFileNameGenerator, long diskCacheSize, int diskCacheFileCount) {
    File reserveCacheDir = createReserveDiskCacheDir(context);
    if (diskCacheSize > 0 || diskCacheFileCount > 0) {
        try {
            return new LruDiscCache(StorageUtils.getIndividualCacheDirectory(context), reserveCacheDir, diskCacheFileNameGenerator, diskCacheSize, diskCacheFileCount);
        } catch (IOException e) {
            L.e(e);
        }
    }
    return new UnlimitedDiscCache(StorageUtils.getCacheDirectory(context), reserveCacheDir, diskCacheFileNameGenerator);
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:12,代码来源:DefaultConfigurationFactory.java

示例5: createDiskCache

import com.nostra13.universalimageloader.cache.disc.DiskCache; //导入依赖的package包/类
public static DiskCache createDiskCache(Context context, FileNameGenerator
        diskCacheFileNameGenerator, long diskCacheSize, int diskCacheFileCount) {
    File reserveCacheDir = createReserveDiskCacheDir(context);
    if (diskCacheSize > 0 || diskCacheFileCount > 0) {
        try {
            return new LruDiskCache(StorageUtils.getIndividualCacheDirectory(context),
                    reserveCacheDir, diskCacheFileNameGenerator, diskCacheSize,
                    diskCacheFileCount);
        } catch (IOException e) {
            L.e(e);
        }
    }
    return new UnlimitedDiskCache(StorageUtils.getCacheDirectory(context), reserveCacheDir,
            diskCacheFileNameGenerator);
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:16,代码来源:DefaultConfigurationFactory.java

示例6: onRemove

import com.nostra13.universalimageloader.cache.disc.DiskCache; //导入依赖的package包/类
/**
 */
@Override
protected boolean onRemove(@NonNull com.nostra13.universalimageloader.core.ImageLoader loader) {
	ensureHasTargetOrThrow();
	final MemoryCache memoryCache = loader.getMemoryCache();
	final boolean removedFromMemory = memoryCache != null && memoryCache.remove(mTarget) != null;
	final DiskCache diskCache = loader.getDiskCache();
	final boolean removedFromDisk = diskCache != null && diskCache.remove(mTarget);
	return removedFromMemory || removedFromDisk;
}
 
开发者ID:albedinsky,项目名称:android_image_loader,代码行数:12,代码来源:ImageTask.java

示例7: createDiskCache

import com.nostra13.universalimageloader.cache.disc.DiskCache; //导入依赖的package包/类
/**
 * Creates default implementation of {@link DiskCache} depends on incoming parameters
 */
public static DiskCache createDiskCache(Context context, FileNameGenerator diskCacheFileNameGenerator,
		long diskCacheSize, int diskCacheFileCount) {
	File reserveCacheDir = createReserveDiskCacheDir(context);
	if (diskCacheSize > 0 || diskCacheFileCount > 0) {
		File individualCacheDir = StorageUtils.getIndividualCacheDirectory(context);
		LruDiscCache diskCache = new LruDiscCache(individualCacheDir, diskCacheFileNameGenerator, diskCacheSize,
				diskCacheFileCount);
		diskCache.setReserveCacheDir(reserveCacheDir);
		return diskCache;
	} else {
		File cacheDir = StorageUtils.getCacheDirectory(context);
		return new UnlimitedDiscCache(cacheDir, reserveCacheDir, diskCacheFileNameGenerator);
	}
}
 
开发者ID:x251089003,项目名称:EveryXDay,代码行数:18,代码来源:DefaultConfigurationFactory.java

示例8: findInCache

import com.nostra13.universalimageloader.cache.disc.DiskCache; //导入依赖的package包/类
public static File findInCache(String s, DiskCache diskcache)
{
    File file = diskcache.get(s);
    if (file != null && file.exists())
    {
        return file;
    } else
    {
        return null;
    }
}
 
开发者ID:vishnudevk,项目名称:MiBandDecompiled,代码行数:12,代码来源:DiskCacheUtils.java

示例9: diskCache

import com.nostra13.universalimageloader.cache.disc.DiskCache; //导入依赖的package包/类
public Builder diskCache(DiskCache diskcache)
{
    if (t > 0L || u > 0)
    {
        L.w("diskCache(), diskCacheSize() and diskCacheFileCount calls overlap each other", new Object[0]);
    }
    if (x != null)
    {
        L.w("diskCache() and diskCacheFileNameGenerator() calls overlap each other", new Object[0]);
    }
    w = diskcache;
    return this;
}
 
开发者ID:vishnudevk,项目名称:MiBandDecompiled,代码行数:14,代码来源:ImageLoaderConfiguration.java

示例10: diskCache

import com.nostra13.universalimageloader.cache.disc.DiskCache; //导入依赖的package包/类
public diskCacheSize diskCache(DiskCache diskcache)
{
    if (t > 0L || u > 0)
    {
        L.w("diskCache(), diskCacheSize() and diskCacheFileCount calls overlap each other", new Object[0]);
    }
    if (x != null)
    {
        L.w("diskCache() and diskCacheFileNameGenerator() calls overlap each other", new Object[0]);
    }
    w = diskcache;
    return this;
}
 
开发者ID:vishnudevk,项目名称:MiBandDecompiled,代码行数:14,代码来源:ImageLoaderConfiguration$Builder.java

示例11: createDiskCache

import com.nostra13.universalimageloader.cache.disc.DiskCache; //导入依赖的package包/类
public static DiskCache createDiskCache(Context context, FileNameGenerator filenamegenerator, long l, int i)
{
    File file = a(context);
    if (l > 0L || i > 0)
    {
        LruDiscCache lrudisccache = new LruDiscCache(StorageUtils.getIndividualCacheDirectory(context), filenamegenerator, l, i);
        lrudisccache.setReserveCacheDir(file);
        return lrudisccache;
    } else
    {
        return new UnlimitedDiscCache(StorageUtils.getCacheDirectory(context), file, filenamegenerator);
    }
}
 
开发者ID:vishnudevk,项目名称:MiBandDecompiled,代码行数:14,代码来源:DefaultConfigurationFactory.java

示例12: findInCache

import com.nostra13.universalimageloader.cache.disc.DiskCache; //导入依赖的package包/类
/** Returns {@link File} of cached image or <b>null</b> if image was not cached in disk cache */
public static File findInCache(String imageUri, DiskCache diskCache) {
	File image = diskCache.get(imageUri);
	return image != null && image.exists() ? image : null;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:6,代码来源:DiskCacheUtils.java

示例13: discCache

import com.nostra13.universalimageloader.cache.disc.DiskCache; //导入依赖的package包/类
/** @deprecated Use {@link #diskCache(com.nostra13.universalimageloader.cache.disc.DiskCache)} */
@Deprecated
public Builder discCache(DiskCache diskCache) {
	return diskCache(diskCache);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:6,代码来源:ImageLoaderConfiguration.java

示例14: findInCache

import com.nostra13.universalimageloader.cache.disc.DiskCache; //导入依赖的package包/类
public static File findInCache(String imageUri, DiskCache diskCache) {
    File image = diskCache.get(imageUri);
    return (image == null || !image.exists()) ? null : image;
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:5,代码来源:DiskCacheUtils.java

示例15: removeFromCache

import com.nostra13.universalimageloader.cache.disc.DiskCache; //导入依赖的package包/类
public static boolean removeFromCache(String imageUri, DiskCache diskCache) {
    File image = diskCache.get(imageUri);
    return image != null && image.exists() && image.delete();
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:5,代码来源:DiskCacheUtils.java


注:本文中的com.nostra13.universalimageloader.cache.disc.DiskCache类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。