Code example for File

Methods: lastModified

0
			return new BitmapDrawable(picPath(size, bioguideId, context));
	} 
	 
	// assumes you've already checked to make sure the file exists 
	public static boolean tooOld(File file) {
		return file.lastModified() < (System.currentTimeMillis() - CACHE_IMAGES);
	} 
	 
	public static String picUrl(String size, String bioguideId) {
		return "http://assets.sunlightfoundation.com/moc/" + size + "/" + bioguideId + ".jpg";
	} 
	 
	public static String picPath(String size, String bioguideId, Context context) {
		return picDir(bioguideId, context) + size + ".jpg"; 
	} 
	 
	public static String picDir(String bioguideId, Context context) {
		File cacheDir = context.getCacheDir();
		if (cacheDir == null)
			cacheDir = context.getFilesDir();
		File picDir = new File(cacheDir.getPath() + "/" + bioguideId);