title: Android - java.io.FileNotFoundException
body: <p>when i was inserting the bitmap image to files directory, it showing file not found exception and it is showing Is a Directory.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>            File mFolder = new File(getFilesDir() + "/sample");
  
              if (!mFolder.exists()) {
                  mFolder.mkdir();
              }
               FileOutputStream fos = null;
               try {
                   fos = new FileOutputStream(mFolder);
                   bitmap.compress(Bitmap.CompressFormat.PNG,70, fos);
  
                   fos.flush();
                   fos.close();
                //   MediaStore.Images.Media.insertImage(getContentResolver(), b, "Screen", "screen");
               }catch (FileNotFoundException e) {
  
                   e.printStackTrace();
               } catch (Exception e) {
  
                   e.printStackTrace();
               }
  </code></pre>
  
  <p><strong>Logcat:</strong></p>
  
  <pre><code>07-12 01:08:05.434: W/System.err(8170): java.io.FileNotFoundException: /data/data/com.sample.sam/files/sample(Is a directory)
  07-12 01:08:05.434: W/System.err(8170):     at org.apache.harmony.luni.platform.OSFileSystem.open(Native Method)
  07-12 01:08:05.434: W/System.err(8170):     at dalvik.system.BlockGuard$WrappedFileSystem.open(BlockGuard.java:239)
  07-12 01:08:05.444: W/System.err(8170):     at java.io.FileOutputStream.&lt;init&gt;(FileOutputStream.java:101)
  07-12 01:08:05.444: W/System.err(8170):     at java.io.FileOutputStream.&lt;init&gt;(FileOutputStream.java:77)
  </code></pre>