title: android - file.exists() returns false for existing file (for anything different than pdf)
body: <p>Both files are present on the sdcard, but for whatever reason exists() returns false the the png file.</p>
  
  <pre><code>//String path = "/mnt/sdcard/Android/data/com.gemoro.toffer/cache/1551619351/0/foto/-921042926.png";
    String path = "/mnt/sdcard/Android/data/com.gemoro.toffer/cache/1551619351/0/foto/-1200240592.pdf";
  
  File file2 = new File(path);
  
  if (null != file2)
  {
      if(file2.exists())
      {
          LOG.x("file exist");
      }
      else
      {
          LOG.x("file does not exist");
      }
  }
  </code></pre>
  
  <p>Now, I've look at what's under the hood, what the method file.exists() does actually and this is what it does:</p>
  
  <pre><code>public boolean exists()
  {
      return doAccess(F_OK);
  }
  
  private boolean doAccess(int mode)
  {
      try
      {
          return Libcore.os.access(path, mode);
      }
      catch (ErrnoException errnoException)
      {
          return false;
      }
  }
  </code></pre>
  
  <p>May it be that the method finishes by throwing the exception and returning false?</p>
  
  <p>If so, </p>
  
  <ul>
  <li>how can I make this work</li>
  <li>what other options to check if a file exists on the sdcard are available for use?</li>
  </ul>
  
  <p>Thanks.</p>