We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
使用单例模式时,初始化配置好了缓存目录,但是下载左右的文本和图片都共用同一个缓存目录,是否有分开的方法:/cache/files ;/cache/images
The text was updated successfully, but these errors were encountered:
不明白你为什么有这种需求,你可以尝试继承DiskCache,重写**getFileForKey()**方法以返回不同的文件路径,不过这似乎不是那么容易。另外,如果你有能力,也可以自己实现一个Cache类,这需要你先熟悉源代码。
DiskCache
Sorry, something went wrong.
可能是阐述的不大清楚,主要是想把本地缓存的文件做一下归类而已,比如,Image Cache 一个目录,Data一个目录,Auduio文件一个目录,如果实在全局配置里吃缓存一个目录,之后是否实例化操作的时候,是否有覆盖默认配得方法?ImageLoader 提供类似方法,看到不少App缓存,子目录都会有分类的,QQ,微信,网易等...当然,最直接的方式就是不用单例,在需要的时候,new 一个对象,但是这样感觉,在new 新对象的时候,其实我并不愿意重新设定新的线程配置等,需要重写默认配置的方法
分目录的动机通常是为了方便以后查看,网络缓存的目录一般不会手动管理,所以如果没有查看的必要,就没有分门别类的必要。 只要你构造的仍然是那个Cache实例,new多少次都是同一结果。
No branches or pull requests
使用单例模式时,初始化配置好了缓存目录,但是下载左右的文本和图片都共用同一个缓存目录,是否有分开的方法:/cache/files ;/cache/images
The text was updated successfully, but these errors were encountered: