Code example for File

Methods: exists, lastModified

0
	 */ 
	public boolean isExists(Context context, String cacheId, int flags) {
 
		if ((flags & FLAG_USE_FILE_CACHE) != 0 && context != null) {
 
			File file = new File(context.getCacheDir(), getCacheFileName(cacheId));
 
			// If not having arrived at the date of the date and file exist, 
			// cache file use. 
			if (file.exists() && file.lastModified() + mFileSavePeriod > System.currentTimeMillis())
				return true; 
 
		} 
 
		if ((flags & FLAG_USE_MEMORY_CACHE) != 0) {
 
			if (mCacheImages.get(cacheId) != null)
				return true; 
 
		}