title: File.exists() not reliable on android device?
body: <p>Recently, I received several exception log thrown in code below:</p>
  
  <pre><code>if(apk != null &amp;&amp; !apk.exists()) {
    throw new Exception("xxxxxx");
  }
  </code></pre>
  
  <p>The apk file is downloaded from cdn server:</p>
  
  <pre><code>download(url, new Listener(){
    public void onSuccess(File tempFile) {
      File apk = getApkFile("apkName.apk");
      renameTo(tempFile, apk); // the apk is mentioned above
    }
  });
  
  public static boolean renameTo(File source, File dest) {
          try {
              FileInputStream fis = new FileInputStream(source);
              FileOutputStream fos = new FileOutputStream(dest);
              byte[] buffer = new byte[4096 * 2];
              int len;
              while ((len = fis.read(buffer)) &gt; 0) {
                  fos.write(buffer, 0, len);
              }
              FileUtils.closeQuietly(fis);
              FileUtils.closeQuietly(fos);
              return source.delete();
          } catch (Exception e) {
          }
          return false;
  }
  
  static File getApkFile(String name) {
          File dir = new File(ContextUtil.get().getFilesDir(), DIR_PLUGIN);
          if (!dir.exists()) {
              dir.mkdir();
          }
          return new File(dir, name);
  }
  </code></pre>
  
  <p>But the count is not too many, about 40 in 400000+ devices, Is there anyone experiences this problem ?</p>