title: How to test for a file in cache?
body: <p>I am trying to test for this cache in my asyncTask. How would i go about doing this?</p>
  
  <pre><code>public void putBitmapInDiskCache(URI imageUri, Bitmap avatar) {   
      File cacheDir = new File(this.getCacheDir(), "thumbnails");
      cacheDir.mkdirs();
      File cacheFile = new File(cacheDir, ""+imageUri.hashCode());   
      try {      
              cacheFile.createNewFile();       
              FileOutputStream fos = new FileOutputStream(cacheFile);    
              avatar.compress(CompressFormat.PNG, 100, fos);       
              fos.flush();       
              fos.close();    
            } catch (Exception e) {       
              Log.e("error", "Error when saving image to cache. ", e);    
  }
  </code></pre>