本文整理汇总了Java中com.androidquery.util.AQUtility.getExistedCacheByUrl方法的典型用法代码示例。如果您正苦于以下问题:Java AQUtility.getExistedCacheByUrl方法的具体用法?Java AQUtility.getExistedCacheByUrl怎么用?Java AQUtility.getExistedCacheByUrl使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.androidquery.util.AQUtility
的用法示例。
在下文中一共展示了AQUtility.getExistedCacheByUrl方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getCachedFile
import com.androidquery.util.AQUtility; //导入方法依赖的package包/类
/**
* Return file cached by ajax or image requests. Returns null if url is not cached.
*
* @param url
* @return File
*/
public File getCachedFile(String url)
{
//return AQUtility.getExistedCacheByUrl(AQUtility.getCacheDir(getContext()), url);
File result = AQUtility.getExistedCacheByUrl(AQUtility.getCacheDir(getContext(), AQuery.CACHE_PERSISTENT), url);
if (result == null)
result = AQUtility.getExistedCacheByUrl(AQUtility.getCacheDir(getContext(), AQuery.CACHE_DEFAULT), url);
return result;
}
示例2: accessFile
import com.androidquery.util.AQUtility; //导入方法依赖的package包/类
protected File accessFile(File cacheDir, String url)
{
if (expire < 0)
return null;
File file = AQUtility.getExistedCacheByUrl(cacheDir, url);
if (file != null && expire != 0)
{
long diff = System.currentTimeMillis() - file.lastModified();
if (diff > expire)
{
return null;
}
}
return file;
}
示例3: getCachedFile
import com.androidquery.util.AQUtility; //导入方法依赖的package包/类
/**
* Return file cached by ajax or image requests. Returns null if url is not cached.
*
* @param url
* @return File
*/
public File getCachedFile(String url){
//return AQUtility.getExistedCacheByUrl(AQUtility.getCacheDir(getContext()), url);
File result = AQUtility.getExistedCacheByUrl(AQUtility.getCacheDir(getContext(), AQuery.CACHE_PERSISTENT), url);
if(result == null) result = AQUtility.getExistedCacheByUrl(AQUtility.getCacheDir(getContext(), AQuery.CACHE_DEFAULT), url);
return result;
}
示例4: accessFile
import com.androidquery.util.AQUtility; //导入方法依赖的package包/类
protected File accessFile(File cacheDir, String url) {
if (expire < 0) return null;
File file = AQUtility.getExistedCacheByUrl(cacheDir, url);
if (file != null && expire != 0) {
long diff = System.currentTimeMillis() - file.lastModified();
if (diff > expire) {
return null;
}
}
return file;
}
示例5: cacheAvailable
import com.androidquery.util.AQUtility; //导入方法依赖的package包/类
protected boolean cacheAvailable(Context context)
{
//return fileCache && AQUtility.getExistedCacheByUrl(context, url) != null;
return fileCache && AQUtility.getExistedCacheByUrl(AQUtility.getCacheDir(context, policy), url) != null;
}
示例6: cacheAvailable
import com.androidquery.util.AQUtility; //导入方法依赖的package包/类
protected boolean cacheAvailable(Context context) {
//return fileCache && AQUtility.getExistedCacheByUrl(context, url) != null;
return fileCache && AQUtility.getExistedCacheByUrl(AQUtility.getCacheDir(context, policy), url) != null;
}