title: fileOutputStream() gives either File Not Found or Not A Directory Error
body: <p><code>imName</code> is a string that is not empty.</p>
  
  <pre><code>                    File f = new File(getFilesDir().toString(),"myP");
                      if(!f.isDirectory())
                      {
                          f.mkdirs();
                      }
                      File fff=new File(f,imName);
                      //fff.createNewFile();
                      System.out.println("fff.getPath "+fff.getAbsolutePath());
                      FileOutputStream fo = new FileOutputStream(fff);
  </code></pre>
  
  <p><code>FileOutputStream fo = new FileOutputStream(fff);</code> gives error as shown below.</p>
  
  <pre><code>2020-05-01 16:12:18.522 13253-13253/com.example.testingproject W/System.err: java.io.FileNotFoundException: /data/user/0/com.example.testingproject/files/myP/jpg_20200501_1612009_.jpg (Not a directory)
  2020-05-01 16:12:18.522 13253-13253/com.example.testingproject W/System.err:     at java.io.FileOutputStream.open(Native Method)
  2020-05-01 16:12:18.523 13253-13253/com.example.testingproject W/System.err:     at java.io.FileOutputStream.&lt;init&gt;(FileOutputStream.java:221)
  2020-05-01 16:12:18.523 13253-13253/com.example.testingproject W/System.err:     at java.io.FileOutputStream.&lt;init&gt;(FileOutputStream.java:169)
  2020-05-01 16:12:18.523 13253-13253/com.example.testingproject W/System.err:     at com.example.testingproject.MainActivity.onActivityResult(MainActivity.java:79)
  2020-05-01 16:12:18.525 13253-13253/com.example.testingproject W/System.err:     at android.app.Activity.dispatchActivityResult(Activity.java:6915)
  2020-05-01 16:12:18.525 13253-13253/com.example.testingproject W/System.err:     at android.app.ActivityThread.deliverResults(ActivityThread.java:4049)
  2020-05-01 16:12:18.526 13253-13253/com.example.testingproject W/System.err:     at android.app.ActivityThread.handleSendResult(ActivityThread.java:4096)
  2020-05-01 16:12:18.526 13253-13253/com.example.testingproject W/System.err:     at android.app.ActivityThread.-wrap20(ActivityThread.java)
  2020-05-01 16:12:18.526 13253-13253/com.example.testingproject W/System.err:     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1516)
  2020-05-01 16:12:18.528 13253-13253/com.example.testingproject W/System.err:     at android.os.Handler.dispatchMessage(Handler.java:102)
  2020-05-01 16:12:18.528 13253-13253/com.example.testingproject W/System.err:     at android.os.Looper.loop(Looper.java:154)
  2020-05-01 16:12:18.528 13253-13253/com.example.testingproject W/System.err:     at android.app.ActivityThread.main(ActivityThread.java:6077)
  2020-05-01 16:12:18.529 13253-13253/com.example.testingproject W/System.err:     at java.lang.reflect.Method.invoke(Native Method)
  2020-05-01 16:12:18.529 13253-13253/com.example.testingproject W/System.err:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
  2020-05-01 16:12:18.531 13253-13253/com.example.testingproject W/System.err:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:756)
  </code></pre>
  
  <p>System out print : <code>fff.getPath /data/user/0/com.example.testingproject/files/myP/jpg_20200501_1612009_.jpg</code></p>
  
  <p>The file exists, and so does the folder. Sometimes the error says the location is not a directory. What could be the issue?</p>