• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java DiskCache类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: discCache

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


示例17: getDiscCache

import com.nostra13.universalimageloader.cache.disc.DiskCache; //导入依赖的package包/类
@Deprecated
public DiskCache getDiscCache() {
    return getDiskCache();
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:5,代码来源:ImageLoader.java


示例18: getDiskCache

import com.nostra13.universalimageloader.cache.disc.DiskCache; //导入依赖的package包/类
public DiskCache getDiskCache() {
    checkConfiguration();
    return this.configuration.diskCache;
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:5,代码来源:ImageLoader.java


示例19: getDiscCache

import com.nostra13.universalimageloader.cache.disc.DiskCache; //导入依赖的package包/类
public static DiskCache getDiscCache() {
    return new UnlimitedDiscCache(new File(ConstantTool.IMAGE_CACHE_PATH), null, new Md5FileNameGenerator());
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:4,代码来源:LetvCacheConfiguration.java


示例20: 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:Spencer231,项目名称:GifImageLoader,代码行数:8,代码来源:ImageLoaderConfiguration.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java DrawLine类代码示例发布时间:2022-05-21
下一篇:
Java MapTileModuleProviderBase类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap